org.apache.struts.tiles

Class ActionComponentServlet


public class ActionComponentServlet
extends ActionServlet

Action Servlet to be used with Tiles and Struts 1.0.x. For Struts 1.1, use TilesPlugin and eventualy TilesRequestProcessor. This servlet extends struts one. It adds channels and screens dispatching capabilities. We overide all methods that do request forward (i.e. 'processActionForward' and 'processValidate') in order to call a new method performing forward. In fact, we copy methods to overide, and change lines doing forward which now call 'processForward()'. Rest of the method is unchanged. This new method could now be overiden in order to dispatch request before forwarding. Compliant to ActionServlet from struts 2001/06/25 00:02:27

Field Summary

private DefinitionsFactory
definitionsFactory
Definitions factory

Fields inherited from class org.apache.struts.action.ActionServlet

config, configDigester, convertNull, dataSources, debug, internal, internalName, log, processor, registrations, servletMapping, servletName

Method Summary

protected void
doForward(String uri, HttpServletRequest request, HttpServletResponse response)
Do a forward, and eventually catch uri containing Tiles definition.
void
init()
Init method.
void
initComponentDefinitionsMapping()
Read component instance mapping configuration file.
protected void
processActionForward(ActionForward forward, ActionMapping mapping, ActionForm formInstance, HttpServletRequest request, HttpServletResponse response)
Overload struts1.0 counterpart in order to catch forward calls.
protected void
processForward(String uri, HttpServletRequest request, HttpServletResponse response)
Deprecated. use doForward instead
protected boolean
processForward(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response)
Overload struts1.0 counterpart in order to catch forward calls.
protected boolean
processInclude(ActionMapping mapping, HttpServletRequest request, HttpServletResponse response)
Overload struts1.0 counterpart in order to catch include calls.
protected boolean
processValidate(ActionMapping mapping, ActionForm formInstance, HttpServletRequest request, HttpServletResponse response)
Overload struts1.0 counterpart in order to catch forward calls.

Methods inherited from class org.apache.struts.action.ActionServlet

addServletMapping, defaultControllerConfig, defaultFormBeansConfig, defaultForwardsConfig, defaultMappingsConfig, defaultMessageResourcesConfig, destroy, destroyApplications, destroyConfigDigester, destroyDataSources, destroyInternal, destroyModules, doGet, doPost, findDataSource, findFormBean, findForward, findMapping, getApplicationConfig, getDebug, getInternal, getModuleConfig, getRequestProcessor, getResources, handleConfigException, init, initApplicationConfig, initApplicationDataSources, initApplicationMessageResources, initApplicationPlugIns, initConfigDigester, initDataSources, initInternal, initModuleConfig, initModuleDataSources, initModuleMessageResources, initModulePlugIns, initOther, initServlet, log, parseModuleConfigFile, process

Field Details

definitionsFactory

private DefinitionsFactory definitionsFactory
Definitions factory

Method Details

doForward

protected void doForward(String uri,
                         HttpServletRequest request,
                         HttpServletResponse response)
            throws IOException,
                   ServletException
Do a forward, and eventually catch uri containing Tiles definition. If uri is a valid uri, do a forward to it. If uri is a valid definition name, Tiles context is created from definition, and definition path is used as uri.

Parameters:
uri - Uri or Definition name to forward
request - Current page request
response - Current page response


init

public void init()
            throws ServletException
Init method. This method is call on any servlet.
Overrides:
init in interface ActionServlet


initComponentDefinitionsMapping

public void initComponentDefinitionsMapping()
            throws ServletException
Read component instance mapping configuration file. This is where we read files properties.


processActionForward

protected void processActionForward(ActionForward forward,
                                    ActionMapping mapping,
                                    ActionForm formInstance,
                                    HttpServletRequest request,
                                    HttpServletResponse response)
            throws IOException,
                   ServletException
Overload struts1.0 counterpart in order to catch forward calls. This is an exact copy, except the call to RequestDispatcher.forward() replaced by doForward(). This method is only used with Struts1.0.x Forward to the specified destination, by the specified mechanism, if an ActionForward instance was returned by the Action.

Parameters:
forward - The ActionForward returned by our action
mapping - The ActionMapping we are processing
formInstance - The ActionForm we are processing
request - The servlet request we are processing
response - The servlet response we are creating


processForward

protected void processForward(String uri,
                              HttpServletRequest request,
                              HttpServletResponse response)
            throws IOException,
                   ServletException

Deprecated. use doForward instead

Do forward, and eventually catch uri containing Tiles definition. Method left for compatibility reasons.

Parameters:
uri - Uri or Definition name to forward
request - Current page request
response - Current page response


processForward

protected boolean processForward(ActionMapping mapping,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws IOException,
                   ServletException
Overload struts1.0 counterpart in order to catch forward calls. This is an exact copy, except the call to RequestDispatcher.forward() replaced by doForward(). This method is only used with Struts1.0.x Process a forward requested by this mapping, if any. Return true if processing of this request should continue (i.e. be processed by an Action class), or false if we have already handled this request.

Parameters:
mapping - The ActionMapping we are processing
request - The request we are processing
response - The response we are processing


processInclude

protected boolean processInclude(ActionMapping mapping,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws IOException,
                   ServletException
Overload struts1.0 counterpart in order to catch include calls. This is an exact copy, except the call to RequestDispatcher.include() replaced by doInclude(). This method is only used with Struts1.0.x Process an include requested by this mapping, if any. Return true if processing of this request should continue (i.e. be processed by an Action class), or false if we have already handled this request.

Parameters:
mapping - The ActionMapping we are processing
request - The request we are processing
response - The response we are processing


processValidate

protected boolean processValidate(ActionMapping mapping,
                                  ActionForm formInstance,
                                  HttpServletRequest request,
                                  HttpServletResponse response)
            throws IOException,
                   ServletException
Overload struts1.0 counterpart in order to catch forward calls. This is an exact copy, except the call to RequestDispatcher.forward() replaced by doForward(). This method is only used with Struts1.0.x Call the validate() method of the specified ActionForm, and forward back to the input form if there are any errors. Return true if we should continue processing (and call the Action class perform() method), or return false if we have already forwarded control back to the input form.

Parameters:
mapping - The ActionMapping we are processing
formInstance - The ActionForm we are processing
request - The servlet request we are processing
response - The servlet response we are processing


Copyright B) 2000-2005 - Apache Software Foundation