com.oroad.stxx.plugin
Class StxxTilesRequestProcessor

java.lang.Object
  extended byorg.apache.struts.action.RequestProcessor
      extended byorg.apache.struts.tiles.TilesRequestProcessor
          extended bycom.oroad.stxx.plugin.StxxTilesRequestProcessor

public class StxxTilesRequestProcessor
extends org.apache.struts.tiles.TilesRequestProcessor

Handles all forwards and includes from Struts. If stxx cannot handle them, it lets Struts handle them normally. To determine whether it should handle a request, it checks for a "dox" ending in the path.

Author:
Jeff Pennal, Don Brown

Field Summary
 
Fields inherited from class org.apache.struts.tiles.TilesRequestProcessor
definitionsFactory, log
 
Fields inherited from class org.apache.struts.action.RequestProcessor
actions, appConfig, INCLUDE_PATH_INFO, INCLUDE_SERVLET_PATH, moduleConfig, servlet
 
Constructor Summary
StxxTilesRequestProcessor()
           
 
Method Summary
 void init(org.apache.struts.action.ActionServlet servlet, org.apache.struts.config.ModuleConfig appConfig)
          Initialize this request processor instance.
protected  void internalModuleRelativeForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Catch the call to a module relative forward.
protected  void internalModuleRelativeInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Do a module relative include to specified uri using request dispatcher.
protected  void processForwardConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.config.ForwardConfig forward)
          Overloaded method from Struts RequestProcessor.
protected  org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String path)
          Select the mapping used to process the selection path for this request.
protected  void processPopulate(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.apache.struts.action.ActionForm form, org.apache.struts.action.ActionMapping mapping)
          If XMLForm libraries are present, populate the form using XMLForm.
 
Methods inherited from class org.apache.struts.tiles.TilesRequestProcessor
doForward, getDefinitionsFactory, initDefinitionsMapping, processTilesDefinition
 
Methods inherited from class org.apache.struts.action.RequestProcessor
destroy, doInclude, getDebug, getInternal, getServletContext, log, log, process, processActionCreate, processActionForm, processActionForward, processActionPerform, processContent, processException, processForward, processInclude, processLocale, processMultipart, processNoCache, processPath, processPreprocess, processRoles, processValidate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StxxTilesRequestProcessor

public StxxTilesRequestProcessor()
Method Detail

init

public void init(org.apache.struts.action.ActionServlet servlet,
                 org.apache.struts.config.ModuleConfig appConfig)
          throws javax.servlet.ServletException
Initialize this request processor instance.

Parameters:
servlet - The ActionServlet we are associated with
appConfig - The ModuleConfig we are associated with.
Throws:
javax.servlet.ServletException - If an error occur during initialization

processForwardConfig

protected void processForwardConfig(javax.servlet.http.HttpServletRequest request,
                                    javax.servlet.http.HttpServletResponse response,
                                    org.apache.struts.config.ForwardConfig forward)
                             throws java.io.IOException,
                                    javax.servlet.ServletException
Overloaded method from Struts RequestProcessor. Forward or redirect to the specified destination, by the specified mechanism. This method catch the struts actionForward call. It checks if the actionForward is done on a stxx definition name. If true, process the definition, and insert it. If false, call the original parent's method.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
forward - The ActionForward controlling where we go next
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet exception occurs

internalModuleRelativeForward

protected void internalModuleRelativeForward(java.lang.String uri,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Catch the call to a module relative forward. If the specified uri is a stxx 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 compute by prefixing the module name.

Parameters:
uri - Module-relative URI to forward to
request - Current page request
response - Current page response
Throws:
java.io.IOException - If something goes wrong
javax.servlet.ServletException - If something goes wrong
Since:
Struts 1.1

internalModuleRelativeInclude

protected void internalModuleRelativeInclude(java.lang.String uri,
                                             javax.servlet.http.HttpServletRequest request,
                                             javax.servlet.http.HttpServletResponse response)
                                      throws java.io.IOException,
                                             javax.servlet.ServletException
Do a module relative include to specified uri using request dispatcher. Uri is relative to the current module. The real uri is compute by prefixing the module name.

Parameters:
uri - Module-relative URI to forward to
request - Current page request
response - Current page response
Throws:
java.io.IOException - If something goes wrong
javax.servlet.ServletException - If something goes wrong
Since:
Struts 1.1

processPopulate

protected void processPopulate(javax.servlet.http.HttpServletRequest request,
                               javax.servlet.http.HttpServletResponse response,
                               org.apache.struts.action.ActionForm form,
                               org.apache.struts.action.ActionMapping mapping)
                        throws javax.servlet.ServletException
If XMLForm libraries are present, populate the form using XMLForm.

Parameters:
request - The request object
response - The response object
mapping - The action mapping
Throws:
javax.servlet.ServletException

processMapping

protected org.apache.struts.action.ActionMapping processMapping(javax.servlet.http.HttpServletRequest request,
                                                                javax.servlet.http.HttpServletResponse response,
                                                                java.lang.String path)
                                                         throws java.io.IOException
Select the mapping used to process the selection path for this request. The search order is as follows: specific mapping (usual Struts behavior), wildcard match, then the "unknown" mapping. If no mapping can be identified, create an error response and return null.

Parameters:
request - The servlet request we are processing
response - The servlet response we are creating
path - The portion of the request URI for selecting a mapping
Returns:
The found and if applicable, wildcard-populated action mapping
Throws:
java.io.IOException - if an input/output error occurs