| java.lang.Object org.apache.struts2.config.ClasspathConfigurationProvider
ClasspathConfigurationProvider | public class ClasspathConfigurationProvider implements ConfigurationProvider(Code) | | ClasspathConfigurationProvider loads the configuration
by scanning the classpath or selected packages for Action classes.
This provider is only invoked if one or more action packages are passed to the dispatcher,
usually from the web.xml.
Configurations are created for objects that either implement Action or have classnames that end with "Action".
|
Inner Class :public static interface PageLocator | |
Inner Class :public static class ClasspathPageLocator implements PageLocator | |
Inner Class :class ResultMap extends HashMap | |
Method Summary | |
public void | destroy() Default destructor. | public void | init(Configuration config) Register this application's configuration. | protected PackageConfig | loadPackageConfig(String actionNamespace, String actionPackage, Class actionClass) Finds or creates the package configuration for an Action class. | protected void | loadPackages(String[] pkgs) Scan a list of packages for Action classes. | public void | loadPackages() Clears and loads the list of packages registered at construction. | public boolean | needsReload() Indicates whether the packages have been initialized. | protected void | processActionClass(Class cls, String[] pkgs) Create a default action mapping for a class instance. | public void | register(ContainerBuilder builder, LocatableProperties props) | public void | setDefaultPageExtension(String defaultPageExtension) Register a default page extension to use when locating pages. | public void | setDefaultPagePrefix(String defaultPagePrefix) Reigster a default page prefix to use when locating pages. | public void | setDefaultParentPackage(String defaultParentPackage) Register a default parent package for the actions. | public void | setForceLowerCase(String force) Whether to use a lowercase letter as the initial letter of an action. | public void | setPageLocator(PageLocator locator) Register a PageLocation to use to scan for server pages. |
ClasspathConfigurationProvider | public ClasspathConfigurationProvider(String[] pkgs)(Code) | | Create instance utilizing a list of packages to scan for Action classes.
Parameters: pkgs - List of pacaktges to scan for Action Classes. |
destroy | public void destroy()(Code) | | Default destructor. Override to provide behavior.
|
init | public void init(Configuration config)(Code) | | Register this application's configuration.
Parameters: config - The configuration for this application. |
loadPackageConfig | protected PackageConfig loadPackageConfig(String actionNamespace, String actionPackage, Class actionClass)(Code) | | Finds or creates the package configuration for an Action class.
The namespace annotation is honored, if found,
and the namespace is checked for a parent configuration.
Parameters: actionNamespace - The configuration namespace Parameters: actionPackage - The Java package containing our Action classes Parameters: actionClass - The Action class instance PackageConfig object for the Action class |
loadPackages | protected void loadPackages(String[] pkgs)(Code) | | Scan a list of packages for Action classes.
This method loads classes that implement the Action interface
or have a class name that ends with the letters "Action".
Parameters: pkgs - A list of packages to load See Also: ClasspathConfigurationProvider.processActionClass |
loadPackages | public void loadPackages() throws ConfigurationException(Code) | | Clears and loads the list of packages registered at construction.
throws: ConfigurationException - |
needsReload | public boolean needsReload()(Code) | | Indicates whether the packages have been initialized.
True if the packages have been initialized |
processActionClass | protected void processActionClass(Class cls, String[] pkgs)(Code) | | Create a default action mapping for a class instance.
The namespace annotation is honored, if found, otherwise
the Java package is converted into the namespace
by changing the dots (".") to slashes ("/").
Parameters: cls - Action or POJO instance to process Parameters: pkgs - List of packages that were scanned for Actions |
register | public void register(ContainerBuilder builder, LocatableProperties props) throws ConfigurationException(Code) | | |
setDefaultPageExtension | public void setDefaultPageExtension(String defaultPageExtension)(Code) | | Register a default page extension to use when locating pages.
Parameters: defaultPageExtension - the new defaultPageExtension |
setDefaultPagePrefix | public void setDefaultPagePrefix(String defaultPagePrefix)(Code) | | Reigster a default page prefix to use when locating pages.
Parameters: defaultPagePrefix - the defaultPagePrefix to set |
setDefaultParentPackage | public void setDefaultParentPackage(String defaultParentPackage)(Code) | | Register a default parent package for the actions.
Parameters: defaultParentPackage - the new defaultParentPackage |
setForceLowerCase | public void setForceLowerCase(String force)(Code) | | Whether to use a lowercase letter as the initial letter of an action.
Parameters: force - If false, actions will retain the initial uppercase letter from the Action class.(view.action (true) versus View.action (false)). |
setPageLocator | public void setPageLocator(PageLocator locator)(Code) | | Register a PageLocation to use to scan for server pages.
Parameters: locator - |
|
|