Package org.apache.struts.tiles
Class TilesRequestProcessor
java.lang.Object
org.apache.struts.action.RequestProcessor
org.apache.struts.tiles.TilesRequestProcessor
- All Implemented Interfaces:
Serializable
RequestProcessor contains the processing logic that the Struts controller servlet performs as it receives each servlet request from the container.
This processor subclasses the Struts RequestProcessor in order to intercept calls to forward or include. When such calls are done, the Tiles processor checks if the specified URI is a definition name. If true, the definition is retrieved and included. If false, the original URI is included or a forward is performed.
Actually, catching is done by overloading the following methods:
- Since:
- Struts 1.1
- See Also:
-
Field Summary
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doForward
(String uri, HttpServletRequest request, HttpServletResponse response) Do a forward using request dispatcher.Get associated definition factory.void
init
(ActionServlet servlet, ModuleConfig moduleConfig) Initialize this request processor instance.protected void
Read component instance mapping configuration file.protected void
internalModuleRelativeForward
(String uri, HttpServletRequest request, HttpServletResponse response) Catch the call to a module relative forward.protected void
internalModuleRelativeInclude
(String uri, HttpServletRequest request, HttpServletResponse response) Do a module relative include to specified uri using request dispatcher.protected void
processForwardConfig
(HttpServletRequest request, HttpServletResponse response, ForwardConfig forward) Overloaded method from Struts' RequestProcessor.protected boolean
processTilesDefinition
(String definitionName, boolean contextRelative, HttpServletRequest request, HttpServletResponse response) Deprecated.use processTilesDefinition(definitionName, request, response) instead.protected boolean
processTilesDefinition
(String definitionName, HttpServletRequest request, HttpServletResponse response) Process a Tile definition name.Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getInternal, getServletContext, process, processActionCreate, processActionForm, processActionPerform, processCachedMessages, processContent, processException, processForward, processInclude, processLocale, processMapping, processMultipart, processNoCache, processPath, processPopulate, processPreprocess, processRoles, processValidate
-
Field Details
-
definitionsFactory
Definitions factory.
-
-
Constructor Details
-
TilesRequestProcessor
public TilesRequestProcessor()
-
-
Method Details
-
init
Initialize this request processor instance.- Overrides:
init
in classRequestProcessor
- Parameters:
servlet
- The ActionServlet we are associated with.moduleConfig
- The ModuleConfig we are associated with.- Throws:
ServletException
- If an error occurs during initialization.
-
initDefinitionsMapping
Read component instance mapping configuration file. This is where we read files properties.- Throws:
ServletException
-
processTilesDefinition
@Deprecated protected boolean processTilesDefinition(String definitionName, boolean contextRelative, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Deprecated.use processTilesDefinition(definitionName, request, response) instead. This method will be removed in a version after 1.3.0.Process a Tile definition name. This method tries to process the parameterdefinitionName
as a definition name. It returnstrue
if a definition has been processed, orfalse
otherwise. This method is deprecated; the method without thecontextRelative
parameter should be used instead.- Parameters:
definitionName
- Definition name to insert.contextRelative
- Is the definition marked contextRelative ?request
- Current page request.response
- Current page response.- Returns:
true
if the method has processed uri as a definition name,false
otherwise.- Throws:
IOException
ServletException
-
processTilesDefinition
protected boolean processTilesDefinition(String definitionName, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Process a Tile definition name. This method tries to process the parameterdefinitionName
as a definition name. It returnstrue
if a definition has been processed, orfalse
otherwise.- Parameters:
definitionName
- Definition name to insert.request
- Current page request.response
- Current page response.- Returns:
true
if the method has processed uri as a definition name,false
otherwise.- Throws:
IOException
ServletException
-
doForward
protected void doForward(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Do a forward using request dispatcher. Uri is a valid uri. If response has already been commited, do an include instead.- Overrides:
doForward
in classRequestProcessor
- Parameters:
uri
- Uri or Definition name to forward.request
- Current page request.response
- Current page response.- Throws:
IOException
ServletException
-
processForwardConfig
protected void processForwardConfig(HttpServletRequest request, HttpServletResponse response, ForwardConfig forward) throws IOException, ServletException Overloaded method from Struts' RequestProcessor. Forward or redirect to the specified destination by the specified mechanism. This method catches the Struts' actionForward call. It checks if the actionForward is done on a Tiles definition name. If true, process the definition and insert it. If false, call the original parent's method.- Overrides:
processForwardConfig
in classRequestProcessor
- Parameters:
request
- The servlet request we are processing.response
- The servlet response we are creating.forward
- The ActionForward controlling where we go next.- Throws:
IOException
- if an input/output error occurs.ServletException
- if a servlet exception occurs.
-
internalModuleRelativeForward
protected void internalModuleRelativeForward(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Catch the call to a module relative forward. If the specified uri is a tiles definition name, insert it. Otherwise, parent processing is called. Do a module relative forward to specified uri using request dispatcher. Uri is relative to the current module. The real uri is computed by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.- Overrides:
internalModuleRelativeForward
in classRequestProcessor
- Parameters:
uri
- Module-relative URI to forward to.request
- Current page request.response
- Current page response.- Throws:
IOException
ServletException
- Since:
- Struts 1.1
-
internalModuleRelativeInclude
protected void internalModuleRelativeInclude(String uri, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException Do a module relative include to specified uri using request dispatcher. Uri is relative to the current module. The real uri is computed by prefixing the module name. This method is used internally and is not part of the public API. It is advised to not use it in subclasses.- Overrides:
internalModuleRelativeInclude
in classRequestProcessor
- Parameters:
uri
- Module-relative URI to forward to.request
- Current page request.response
- Current page response.- Throws:
IOException
ServletException
- Since:
- Struts 1.1
-
getDefinitionsFactory
Get associated definition factory.
-