Package 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:
Serializable
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:
-
Field Summary
Fields inherited from class org.apache.struts.tiles.TilesUtilImpl
DEFINITIONS_FACTORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.getDefinitionsFactory
(ServletContext servletContext, ModuleConfig moduleConfig) Get definition factory for the module attached to specified moduleConfig.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.Methods inherited from class org.apache.struts.tiles.TilesUtilImpl
createDefinitionFactoryInstance, createDefinitionsFactory, doInclude
-
Constructor Details
-
TilesUtilStrutsModulesImpl
public TilesUtilStrutsModulesImpl()
-
-
Method Details
-
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.- Overrides:
doForward
in classTilesUtilImpl
- Parameters:
uri
- Uri or Definition name to forward.request
- Current page request.response
- Current page response.servletContext
- Current servlet context.- Throws:
IOException
ServletException
-
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.- Overrides:
doInclude
in classTilesUtilImpl
- Parameters:
uri
- Uri or Definition name to forward.request
- Current page request.response
- Current page response.servletContext
- Current servlet context.- Throws:
IOException
ServletException
-
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory(ServletRequest request, ServletContext servletContext) Get the definition factory from appropriate servlet context.- Overrides:
getDefinitionsFactory
in classTilesUtilImpl
- Parameters:
request
- Current request.servletContext
- Current servlet context.- Returns:
- Definitions factory or null if not found.
-
getDefinitionsFactory
public DefinitionsFactory getDefinitionsFactory(ServletContext servletContext, ModuleConfig moduleConfig) Get definition factory for the module attached to specified moduleConfig.- Overrides:
getDefinitionsFactory
in classTilesUtilStrutsImpl
- 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, ServletContext servletContext) Make definition factory accessible to tags. Factory is stored in servlet context.- Overrides:
makeDefinitionsFactoryAccessible
in classTilesUtilImpl
- Parameters:
factory
- Factory to be made accessible.servletContext
- Current servlet context.
-
getRequestProcessor
protected TilesRequestProcessor getRequestProcessor(HttpServletRequest request, 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
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.
-