org.apache.struts.tiles
Class StrutsModulesTilesUtilImpl

java.lang.Object
  |
  +--org.apache.struts.tiles.DefaultTilesUtilImpl
        |
        +--org.apache.struts.tiles.StrutsModulesTilesUtilImpl
All Implemented Interfaces:
TilesUtilInterface

public class StrutsModulesTilesUtilImpl
extends DefaultTilesUtilImpl
implements TilesUtilInterface

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


Field Summary
protected  org.apache.commons.logging.Log log
          Commons Logging instance.
 
Fields inherited from class org.apache.struts.tiles.DefaultTilesUtilImpl
DEFINITIONS_FACTORY
 
Constructor Summary
StrutsModulesTilesUtilImpl()
           
 
Method Summary
 DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext, DefinitionsFactoryConfig factoryConfig)
          Create Definition factory from specified configuration object.
 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.ServletRequest request, javax.servlet.ServletContext servletContext)
          Get definition factory from appropriate servlet context.
protected  org.apache.struts.config.ApplicationConfig getModuleConfig(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
          Get the current ApplicationConfig.
protected  TilesRequestProcessor getRequestProcessor(javax.servlet.http.HttpServletRequest request, javax.servlet.ServletContext servletContext)
          Get Tiles request processor 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.DefaultTilesUtilImpl
createDefinitionFactoryInstance, getDefaultDefinitionsFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.struts.tiles.TilesUtilInterface
getDefaultDefinitionsFactory
 

Field Detail

log

protected org.apache.commons.logging.Log log
Commons Logging instance.

Constructor Detail

StrutsModulesTilesUtilImpl

public StrutsModulesTilesUtilImpl()
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.

Specified by:
doForward in interface TilesUtilInterface
Overrides:
doForward in class DefaultTilesUtilImpl
Parameters:
uri - Uri or Definition name to forward
request - Current page request
response - Current page response
servletContext - Current servlet context
java.io.IOException
javax.servlet.ServletException

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.

Specified by:
doInclude in interface TilesUtilInterface
Overrides:
doInclude in class DefaultTilesUtilImpl
Parameters:
uri - Uri or Definition name to forward
request - Current page request
response - Current page response
servletContext - Current servlet context
java.io.IOException
javax.servlet.ServletException

getDefinitionsFactory

public DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletRequest request,
                                                javax.servlet.ServletContext servletContext)
Get definition factory from appropriate servlet context.

Specified by:
getDefinitionsFactory in interface TilesUtilInterface
Overrides:
getDefinitionsFactory in class DefaultTilesUtilImpl
Parameters:
servletContext - Current servlet context
Returns:
Definitions factory or null if not found.

createDefinitionsFactory

public DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext,
                                                   DefinitionsFactoryConfig factoryConfig)
                                            throws DefinitionsFactoryException
Create Definition factory from specified configuration object. Create a ConfigurableDefinitionsFactory and initialize it with the configuration object. This later can contains the factory classname to use. Factory is made accessible from tags.

Fallback of several factory creation methods.

Specified by:
createDefinitionsFactory in interface TilesUtilInterface
Overrides:
createDefinitionsFactory in class DefaultTilesUtilImpl
Parameters:
servletContext - Servlet Context passed to newly created factory.
factoryConfig - Configuration object passed to factory.
Returns:
newly created factory of type ConfigurableDefinitionsFactory.
Throws:
DefinitionsFactoryException - If an error occur while initializing factory

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 DefaultTilesUtilImpl
Parameters:
factory - Factory to make accessible
servletContext - Current servlet context

getRequestProcessor

protected TilesRequestProcessor getRequestProcessor(javax.servlet.http.HttpServletRequest request,
                                                    javax.servlet.ServletContext servletContext)
Get Tiles request processor associated to the current module.


getModuleConfig

protected org.apache.struts.config.ApplicationConfig getModuleConfig(javax.servlet.http.HttpServletRequest request,
                                                                     javax.servlet.ServletContext servletContext)
Get the current ApplicationConfig.
Lookup in the request, and do selectApplication if not found. The side effect is that the Application object is set in the request if it was not present.



Copyright 2000-2002 - Cedric Dumoulin and Apache Software Foundation