org.apache.struts.tiles
Class TilesUtilStrutsModulesImpl
- Serializable
public class TilesUtilStrutsModulesImpl
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.
void | doForward(String uri, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) - Do a forward using request dispatcher.
|
void | doInclude(String uri, HttpServletRequest request, HttpServletResponse response, ServletContext servletContext) - Do an include using request dispatcher.
|
DefinitionsFactory | getDefinitionsFactory(ServletContext servletContext, ModuleConfig moduleConfig) - Get definition factory for the module attached to specified moduleConfig.
|
DefinitionsFactory | getDefinitionsFactory(ServletRequest request, ServletContext servletContext) - Get the definition factory from appropriate servlet context.
|
protected ModuleConfig | getModuleConfig(HttpServletRequest request, ServletContext servletContext) - Get the current ModuleConfig.
|
protected TilesRequestProcessor | getRequestProcessor(HttpServletRequest request, ServletContext servletContext) - Get Tiles RequestProcessor associated to the current module.
|
protected void | makeDefinitionsFactoryAccessible(DefinitionsFactory factory, ServletContext servletContext) - Make definition factory accessible to tags.
|
doForward
public void doForward(String uri,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
throws IOException,
ServletException
Do a forward using request dispatcher.
This method is used by the Tiles package anytime a forward is required.
- doForward in interface TilesUtilImpl
uri
- Uri or Definition name to forward.request
- Current page request.response
- Current page response.servletContext
- Current servlet context.
doInclude
public void doInclude(String uri,
HttpServletRequest request,
HttpServletResponse response,
ServletContext servletContext)
throws IOException,
ServletException
Do an include using request dispatcher.
This method is used by the Tiles package anytime an include is required.
- doInclude in interface TilesUtilImpl
uri
- Uri or Definition name to forward.request
- Current page request.response
- Current page response.servletContext
- Current servlet context.
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory(ServletContext servletContext,
ModuleConfig moduleConfig)
Get definition factory for the module attached to specified moduleConfig.
- getDefinitionsFactory in interface TilesUtilStrutsImpl
servletContext
- Current servlet context.moduleConfig
- Module config of the module for which the factory is requested.
- Definitions factory or null if not found.
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory(ServletRequest request,
ServletContext servletContext)
Get the definition factory from appropriate servlet context.
- getDefinitionsFactory in interface TilesUtilImpl
request
- Current request.servletContext
- Current servlet context.
- Definitions factory or null if not found.
getModuleConfig
protected ModuleConfig getModuleConfig(HttpServletRequest request,
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.
request
- Current request.servletContext
- Current servlet context*.
- The ModuleConfig for current request.
getRequestProcessor
protected TilesRequestProcessor getRequestProcessor(HttpServletRequest request,
ServletContext servletContext)
Get Tiles RequestProcessor associated to the current module.
request
- Current request.servletContext
- Current servlet context.
makeDefinitionsFactoryAccessible
protected void makeDefinitionsFactoryAccessible(DefinitionsFactory factory,
ServletContext servletContext)
Make definition factory accessible to tags.
Factory is stored in servlet context.
- makeDefinitionsFactoryAccessible in interface TilesUtilImpl
factory
- Factory to be made accessible.servletContext
- Current servlet context.
Copyright B) 2000-2007 - The Apache Software Foundation