com.ibm.portal.struts.portlet
Class WpTilesRequestProcessor

java.lang.Object
  extended by RequestProcessor
      extended by com.ibm.portal.struts.portlet.WpRequestProcessor
          extended by com.ibm.portal.struts.portlet.WpTilesRequestProcessor

public class WpTilesRequestProcessor
extends WpRequestProcessor

WpTilesRequestProcessor contains the processing logic that the Struts controller servlet performs as it receives each servlet request from the container.

This tiles request processor extends the WpRequestProcessor so that processing is can be matched to the portal's two phase processing.

Since:
5.1

Field Summary
protected  DefinitionsFactory definitionsFactory
          The Definitions factory
protected static Log log
          The commons Logging instance for this class
protected static MessageResources messages
          The message resources for the Struts Portlet Framework.
 
Constructor Summary
WpTilesRequestProcessor()
          WpTilesRequestProcessor constructor
 
Method Summary
protected  void doForward(java.lang.String uri, HttpServletRequest request, HttpServletResponse response)
          Forward the URI.
 DefinitionsFactory getDefinitionsFactory()
          Get associated definition factory.
 void init(ActionServlet servlet, ModuleConfig moduleConfig)
          Initialize the request processor instance.
protected  void initDefinitionsMapping()
          initialize the definitions mappings
protected  void internalModuleRelativeForward(java.lang.String uri, HttpServletRequest request, HttpServletResponse response)
          Description from the Struts Tiles Request Processor.
protected  void internalModuleRelativeInclude(java.lang.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)
          Description from the Struts Tiles Request Processor.
protected  boolean processTilesDefinition(java.lang.String definitionName, boolean contextRelative, HttpServletRequest request, HttpServletResponse response)
          Process a Tile definition name.
 
Methods inherited from class com.ibm.portal.struts.portlet.WpRequestProcessor
doInclude, getApplicationPrefix, getModuleContext, getServletContext, getStrutsInfo, processActionPerform, processContent, processException, processMapping, processMultipart, processNewActionUri, processNoCache, processPopulate, processRoles, processUri, setServletContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

protected static MessageResources messages
The message resources for the Struts Portlet Framework.


definitionsFactory

protected DefinitionsFactory definitionsFactory
The Definitions factory


log

protected static Log log
The commons Logging instance for this class

Constructor Detail

WpTilesRequestProcessor

public WpTilesRequestProcessor()
WpTilesRequestProcessor constructor

Method Detail

init

public void init(ActionServlet servlet,
                 ModuleConfig moduleConfig)
          throws ServletException
Initialize the request processor instance. The definitions mappings are initialized here

Overrides:
init in class WpRequestProcessor
Parameters:
servlet - The ActionServlet we are associated with.
moduleConfig - The ModuleConfig we are associated with.
Throws:
ServletException - If an error occurs during initialization.

initDefinitionsMapping

protected void initDefinitionsMapping()
                               throws ServletException
initialize the definitions mappings

Throws:
ServletException - if a servlet exception occurs.

processTilesDefinition

protected boolean processTilesDefinition(java.lang.String definitionName,
                                         boolean contextRelative,
                                         HttpServletRequest request,
                                         HttpServletResponse response)
                                  throws java.io.IOException,
                                         ServletException
Process a Tile definition name. This implementation does not call controller perform method. That is done by the StrutsViewTilesCommand

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:
java.io.IOException - if an input/output error occurs.
ServletException - if a servlet exception occurs.

doForward

protected void doForward(java.lang.String uri,
                         HttpServletRequest request,
                         HttpServletResponse response)
                  throws java.io.IOException,
                         ServletException
Forward the URI. In the Portal environment, the response has already been committed, so this method always calls doInclude.

Overrides:
doForward in class WpRequestProcessor
Parameters:
uri - Uri or Definition name to forward.
request - Current page request.
response - Current page response.
Throws:
java.io.IOException - if an input/output error occurs
ServletException - if a servlet exception occurs

processForwardConfig

protected void processForwardConfig(HttpServletRequest request,
                                    HttpServletResponse response,
                                    ForwardConfig forward)
                             throws java.io.IOException,
                                    ServletException

Description from the Struts Tiles Request Processor.

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 class WpRequestProcessor
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.
ServletException - if a servlet exception occurs.

internalModuleRelativeForward

protected void internalModuleRelativeForward(java.lang.String uri,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws java.io.IOException,
                                             ServletException

Description from the Struts Tiles Request Processor.

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.

Parameters:
uri - Module-relative URI to forward to.
request - Current page request.
response - Current page response.
Throws:
java.io.IOException - if an input/output error occurs.
ServletException - if a servlet exception occurs.

internalModuleRelativeInclude

protected void internalModuleRelativeInclude(java.lang.String uri,
                                             HttpServletRequest request,
                                             HttpServletResponse response)
                                      throws java.io.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 advice to not use it in subclasses.

Parameters:
uri - Module-relative URI to forward to.
request - Current page request.
response - Current page response.
Throws:
java.io.IOException
ServletException
Since:
Struts 1.1

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory()
Get associated definition factory.