| org.apache.beehive.netui.pageflow.AutoRegisterActionServlet
All known Subclasses: org.apache.beehive.netui.pageflow.PageFlowActionServlet,
AutoRegisterActionServlet | public class AutoRegisterActionServlet extends ActionServlet (Code) | | ActionServlet that automatically registers requested Struts modules based on a set of module configuration file
locators. The user may specify
ModuleConfigLocator classes in /WEB-INF/beehive-netui-config.xml using the
<module-config-locators> element.
|
Inner Class :public static interface ModuleConfigLocator | |
Inner Class :static class MissingRootModuleControllerConfig extends ControllerConfig | |
Method Summary | |
public void | clearRegisteredModules() Clear the internal map of registered modules. | public void | destroy() | public ModuleConfig | ensureModuleRegistered(String modulePath, ServletRequest request) Ensures that the Struts module for the given path is registered (dynamically, if necessary). | public ModuleConfig | ensureModuleRegistered(String modulePath) | protected URL | getConfigResource(String path) Get a resource URL for a module configuration file. | protected InputStream | getConfigResourceAsStream(String path) Get a resource stream for a module configuration file. | protected ModuleConfigLocator[] | getDefaultModuleConfigLocators() Get the base list of ModuleConfigLocators, to specify locations for auto-registered Struts modules. | public String | getInitParameter(String s) | public Enumeration | getInitParameterNames() | public String | getModuleConfPath(String modulePath) Get the webapp-relative path to the Struts module configration file for a given module path,
based on registered ModuleConfigLocators.
Parameters: modulePath - the Struts module path. | protected ModuleConfig | getModuleConfig(String modulePath, ServletRequest request, ServletResponse response) Get the Struts ModuleConfig for the given module path. | public ModuleConfigLocator[] | getModuleConfigLocators() Get the current list of registered ModuleConfigLocators. | public void | init() | protected Digester | initConfigDigester() | protected ModuleConfig | initModuleConfig(String prefix, String paths) This method is almost exactly the same as the base class initModuleConfig. | protected boolean | moduleCanHandlePath(ModuleConfig moduleConfig, RequestProcessor rp, String servletPath) Tell whether the given module can handle the given path. | protected void | process(HttpServletRequest request, HttpServletResponse response) This override of the base class process() registers a Struts module on the fly if the
config file can be found in our standard place (named in our standard way), regardless
of whether the module is configured in web.xml. | protected boolean | processUnhandledAction(HttpServletRequest request, HttpServletResponse response, String uri) Last chance to handle an unhandled action URI. | protected synchronized ModuleConfig | registerModule(String modulePath, String configFilePath) Register a Struts module, initialized by the given configuration file.
Parameters: modulePath - the module path, starting at the webapp root, e.g., "/info/help". Parameters: configFilePath - the path, starting at the webapp root, to the module configurationfile (e.g., "/WEB-INF/my-generated-struts-config-info-help.xml"). |
MODULE_CONFIG_LOCATOR_CLASS_ATTR | public static String MODULE_CONFIG_LOCATOR_CLASS_ATTR(Code) | | ModuleConfigLocator |
clearRegisteredModules | public void clearRegisteredModules()(Code) | | Clear the internal map of registered modules.
|
destroy | public void destroy()(Code) | | |
ensureModuleRegistered | public ModuleConfig ensureModuleRegistered(String modulePath, ServletRequest request) throws IOException, ServletException(Code) | | Ensures that the Struts module for the given path is registered (dynamically, if necessary).
Parameters: modulePath - the module path, from the request URI. Parameters: request - the current ServletRequest throws: IOException - throws: ServletException - |
getConfigResource | protected URL getConfigResource(String path) throws MalformedURLException(Code) | | Get a resource URL for a module configuration file. By default, this looks in the ServletContext
and in the context classloader.
Parameters: path - the path to the resource. an URL for the resource, or null if the resource is not found. throws: MalformedURLException - |
getConfigResourceAsStream | protected InputStream getConfigResourceAsStream(String path)(Code) | | Get a resource stream for a module configuration file. By default, this looks in the ServletContext
and in the context classloader.
Parameters: path - the path to the resource. an InputStream for the resource, or null if the resource is not found. |
getDefaultModuleConfigLocators | protected ModuleConfigLocator[] getDefaultModuleConfigLocators()(Code) | | Get the base list of ModuleConfigLocators, to specify locations for auto-registered Struts modules. By default,
this list is empty; derived classes may override to provide locators, or the user may specify them using
the "moduleConfigLocators" init-parameter. When an unrecognized Struts module is requested, each registered
ModuleConfigLocator is queried for a possible path to the configuration file for the module. If the
configuration file is found, the module is auto-registered against the file.
|
getModuleConfPath | public String getModuleConfPath(String modulePath)(Code) | | Get the webapp-relative path to the Struts module configration file for a given module path,
based on registered ModuleConfigLocators.
Parameters: modulePath - the Struts module path. a String that is the path to the Struts configuration file, relative to the web application root,or null if no appropriate configuration file is found. See Also: AutoRegisterActionServlet.getDefaultModuleConfigLocators |
initModuleConfig | protected ModuleConfig initModuleConfig(String prefix, String paths) throws ServletException(Code) | | This method is almost exactly the same as the base class initModuleConfig. The only difference
is that it does not throw an UnavailableException if a module configuration file is missing or
invalid.
|
moduleCanHandlePath | protected boolean moduleCanHandlePath(ModuleConfig moduleConfig, RequestProcessor rp, String servletPath)(Code) | | Tell whether the given module can handle the given path. By default, this is always true.
|
process | protected void process(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException(Code) | | This override of the base class process() registers a Struts module on the fly if the
config file can be found in our standard place (named in our standard way), regardless
of whether the module is configured in web.xml.
|
registerModule | protected synchronized ModuleConfig registerModule(String modulePath, String configFilePath) throws ServletException(Code) | | Register a Struts module, initialized by the given configuration file.
Parameters: modulePath - the module path, starting at the webapp root, e.g., "/info/help". Parameters: configFilePath - the path, starting at the webapp root, to the module configurationfile (e.g., "/WEB-INF/my-generated-struts-config-info-help.xml"). the Struts ModuleConfig that was initialized. |
|
|