org.apache.beehive.netui.pageflow
Class PageFlowActionServlet
Object
GenericServlet
HttpServlet
ActionServlet
AutoRegisterActionServlet
PageFlowActionServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
- Direct Known Subclasses:
- DynamicSubappActionServlet
public class PageFlowActionServlet
- extends AutoRegisterActionServlet
ActionServlet that dynamically registers modules based on naming/location conventions for Struts
configuration files that are generated by the Page Flow compiler. These files are located in
/WEB-INF/.pageflow-struts-generated, and are named jpf-struts-config-module-name.xml.
The user may specify additional PageFlowActionServlet.DefaultModuleConfigLocator
classes in web.xml, using the
"moduleConfigLocators" init-parameter; this allows the user to define other patterns for
auto-registered Struts modules.
- See Also:
- Serialized Form
Fields inherited from class ActionServlet |
config, configDigester, convertNull, dataSources, internal, internalName, log, processor, registrations, servletMapping, servletName |
Method Summary |
void |
addServletMapping(String servletName,
String urlPattern)
Struts keeps track of the action servlet URL pattern (e.g., *.do) so it can construct action
URIs. |
protected AutoRegisterActionServlet.ModuleConfigLocator[] |
getDefaultModuleConfigLocators()
Get the base list of ModuleConfigLocators, to specify locations for auto-registered Struts modules. |
String |
getModuleConfPath(String modulePath)
Get the webapp-relative path to the Struts module configration file for a given module path. |
void |
init()
|
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. |
Methods inherited from class AutoRegisterActionServlet |
clearRegisteredModules, destroy, ensureModuleRegistered, getConfigResource, getConfigResourceAsStream, getInitParameter, getInitParameterNames, getModuleConfig, getModuleConfigLocators, initConfigDigester, initModuleConfig, registerModule |
Methods inherited from class ActionServlet |
destroyConfigDigester, destroyInternal, destroyModules, doGet, doPost, getInternal, getModuleConfig, getRequestProcessor, initInternal, initModuleConfigFactory, initModuleDataSources, initModuleMessageResources, initModulePlugIns, initModulePrefixes, initOther, initServlet, parseModuleConfigFile |
Methods inherited from class HttpServlet |
doDelete, doHead, doOptions, doPut, doTrace, getLastModified, service, service |
Methods inherited from class GenericServlet |
getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PageFlowActionServlet
public PageFlowActionServlet()
getDefaultModuleConfigLocators
protected AutoRegisterActionServlet.ModuleConfigLocator[] getDefaultModuleConfigLocators()
- Get the base list of ModuleConfigLocators, to specify locations for auto-registered Struts modules. By default,
this ActionServlet auto-registers Struts modules whose configuration files are located at
"/WEB-INF/.pageflow-struts-generated/jpf-struts-config-<module>". Overriding this method allows
alternate locations to be specified. 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.
- Overrides:
getDefaultModuleConfigLocators
in class AutoRegisterActionServlet
init
public void init()
throws ServletException
- Overrides:
init
in class AutoRegisterActionServlet
- Throws:
ServletException
process
protected void process(HttpServletRequest request,
HttpServletResponse response)
throws IOException,
ServletException
- Description copied from class:
AutoRegisterActionServlet
- 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.
- Overrides:
process
in class AutoRegisterActionServlet
- Throws:
IOException
ServletException
getModuleConfPath
public String getModuleConfPath(String modulePath)
- Get the webapp-relative path to the Struts module configration file for a given module path. By default,
this is "/WEB-INF/.pageflow-struts-generated/jpf-struts-config-<module>", but alternate
locations can be specified by adding
PageFlowActionServlet.DefaultModuleConfigLocator
s.
- Overrides:
getModuleConfPath
in class AutoRegisterActionServlet
- Parameters:
modulePath
- the Struts module path.
- Returns:
- a String that is the path to the Struts configuration file, relative to the web application root.
- See Also:
getDefaultModuleConfigLocators()
addServletMapping
public void addServletMapping(String servletName,
String urlPattern)
- Struts keeps track of the action servlet URL pattern (e.g., *.do) so it can construct action
URIs. We want to prevent it from noticing *.jpf so it doesn't use that to construct the URIs.
- Overrides:
addServletMapping
in class ActionServlet
processUnhandledAction
protected boolean processUnhandledAction(HttpServletRequest request,
HttpServletResponse response,
String uri)
throws IOException,
ServletException
- Last chance to handle an unhandled action URI.
- Overrides:
processUnhandledAction
in class AutoRegisterActionServlet
- Returns:
true
if this method handled it (by forwarding somewhere or writing to the response).
- Throws:
IOException
ServletException