Apache Struts API Documentation: Class TilesUtilStrutsModulesImpl

Apache Struts API


org.apache.struts.tiles Class TilesUtilStrutsModulesImpl

java.lang.Object
  |
  +--org.apache.struts.tiles.TilesUtilImpl
        |
        +--org.apache.struts.tiles.TilesUtilStrutsImpl
              |
              +--org.apache.struts.tiles.TilesUtilStrutsModulesImpl
All Implemented Interfaces:
java.io.Serializable

public class TilesUtilStrutsModulesImpl
extends TilesUtilStrutsImpl

Implementation of TilesUtil for Struts multi modules. Methods in this implementation are aware of the Struts module context.

  • The method getFactory(...) returns the factory for the current Struts module.
  • Methods doForward() and doInclude() use their counterparts in the current RequestProcessor (todo).
  • The method createFactory(...) creates a factory for the current module and stores it under the appropriate property name.

See Also:
Serialized Form

Fields inherited from class org.apache.struts.tiles.TilesUtilImpl
DEFINITIONS_FACTORY, log
 
Constructor Summary
TilesUtilStrutsModulesImpl()
           
 
Method Summary
 void doForward(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
          Do a forward using request dispatcher.
 void doInclude(java.lang.String uri, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, javax.servlet.ServletContext servletContext)
          Do an include using request dispatcher.
 DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletContext servletContext, ModuleConfig moduleConfig)
          Get definition factory for the module attached to specified moduleConfig.
 DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext)
          Get the definition factory from appropriate servlet context.
protected  ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
          Get the current ModuleConfig.
protected  TilesRequestProcessor getRequestProcessor(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
          Get Tiles RequestProcessor associated to the current module.
protected  void makeDefinitionsFactoryAccessible(DefinitionsFactory factory, javax.servlet.ServletContext servletContext)
          Make definition factory accessible to tags.
 
Methods inherited from class org.apache.struts.tiles.TilesUtilImpl
createDefinitionFactoryInstance, createDefinitionsFactory, doInclude
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

TilesUtilStrutsModulesImpl

public TilesUtilStrutsModulesImpl()
Method Detail

doForward

public void doForward(java.lang.String uri,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      javax.servlet.ServletContext servletContext)
               throws java.io.IOException,
                      javax.servlet.ServletException
Do a forward using request dispatcher. This method is used by the Tiles package anytime a forward is required.
Overrides:
doForward in class TilesUtilImpl
Parameters:
uri - Uri or Definition name to forward.
request - Current page request.
response - Current page response.
servletContext - Current servlet context.

doInclude

public void doInclude(java.lang.String uri,
                      javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response,
                      javax.servlet.ServletContext servletContext)
               throws java.io.IOException,
                      javax.servlet.ServletException
Do an include using request dispatcher. This method is used by the Tiles package anytime an include is required.
Overrides:
doInclude in class TilesUtilImpl
Parameters:
uri - Uri or Definition name to forward.
request - Current page request.
response - Current page response.
servletContext - Current servlet context.

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletRequest request,
                                                javax.servlet.ServletContext servletContext)
Get the definition factory from appropriate servlet context.
Overrides:
getDefinitionsFactory in class TilesUtilImpl
Parameters:
request - Current request.
servletContext - Current servlet context.
Returns:
Definitions factory or null if not found.

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                ModuleConfig moduleConfig)
Get definition factory for the module attached to specified moduleConfig.
Overrides:
getDefinitionsFactory in class TilesUtilStrutsImpl
Parameters:
servletContext - Current servlet context.
moduleConfig - Module config of the module for which the factory is requested.
Returns:
Definitions factory or null if not found.

makeDefinitionsFactoryAccessible

protected void makeDefinitionsFactoryAccessible(DefinitionsFactory factory,
                                                javax.servlet.ServletContext servletContext)
Make definition factory accessible to tags. Factory is stored in servlet context.
Overrides:
makeDefinitionsFactoryAccessible in class TilesUtilImpl
Parameters:
factory - Factory to be made accessible.
servletContext - Current servlet context.

getRequestProcessor

protected TilesRequestProcessor getRequestProcessor(javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.ServletContext servletContext)
Get Tiles RequestProcessor associated to the current module.
Parameters:
request - Current request.
servletContext - Current servlet context.
Returns:
The TilesRequestProcessor for the current request.

getModuleConfig

protected ModuleConfig getModuleConfig(javax.servlet.http.HttpServletRequest request,
                                       javax.servlet.ServletContext servletContext)
Get the current ModuleConfig.
Lookup in the request and do selectModule if not found. The side effect is, that the ModuleConfig object is set in the request if it was not present.
Parameters:
request - Current request.
servletContext - Current servlet context*.
Returns:
The ModuleConfig for current request.


Copyright © 2000-2005 - The Apache Software Foundation