|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.TilesUtil
public class TilesUtil
Class containing utility methods for Tiles.
Methods of this class are static and thereby accessible from anywhere.
The underlying implementation can be changed with
setTilesUtil(TilesUtilImpl)
.
Real implementation classes should derive from the TilesUtilImpl
class.
Some methods are specified to throw the UnsupportedOperationException
if the underlying implementation doesn't support the operation.
Field Summary | |
---|---|
protected static org.apache.commons.logging.Log |
log
Commons Logging instance. |
protected static TilesUtilImpl |
tilesUtilImpl
The implementation of tilesUtilImpl |
Constructor Summary | |
---|---|
TilesUtil()
|
Method Summary | |
---|---|
static DefinitionsFactory |
createDefinitionsFactory(javax.servlet.ServletContext servletContext,
DefinitionsFactoryConfig factoryConfig)
Create Definition factory from specified configuration object. |
static 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. |
static 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. |
static void |
doInclude(java.lang.String uri,
javax.servlet.jsp.PageContext pageContext)
Do an include using PageContext.include(). |
static void |
doInclude(java.lang.String uri,
javax.servlet.jsp.PageContext pageContext,
boolean flush)
Do an include using PageContext.include(). |
static ComponentDefinition |
getDefinition(java.lang.String definitionName,
javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Get a definition by its name. |
static DefinitionsFactory |
getDefinitionsFactory(javax.servlet.ServletRequest request,
javax.servlet.ServletContext servletContext)
Get definition factory from appropriate servlet context. |
static TilesUtilImpl |
getTilesUtil()
Get the real implementation. |
static void |
setTilesUtil(TilesUtilImpl tilesUtil)
Set the real implementation. |
protected static void |
testReset()
Reset internal state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
protected static TilesUtilImpl tilesUtilImpl
Constructor Detail |
---|
public TilesUtil()
Method Detail |
---|
public static TilesUtilImpl getTilesUtil()
public static void setTilesUtil(TilesUtilImpl tilesUtil)
tilesUtil
- The implementaion.public static 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
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
public static 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
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
public static void doInclude(java.lang.String uri, javax.servlet.jsp.PageContext pageContext) throws java.io.IOException, javax.servlet.ServletException
uri
- Uri or Definition name to forward.pageContext
- Current page context.
java.io.IOException
javax.servlet.ServletException
public static void doInclude(java.lang.String uri, javax.servlet.jsp.PageContext pageContext, boolean flush) throws java.io.IOException, javax.servlet.ServletException
uri
- Uri or Definition name to forward.flush
- If the writer should be flushed before the includepageContext
- Current page context.
java.io.IOException
javax.servlet.ServletException
public static DefinitionsFactory getDefinitionsFactory(javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext)
null
if not found.public static DefinitionsFactory createDefinitionsFactory(javax.servlet.ServletContext servletContext, DefinitionsFactoryConfig factoryConfig) throws DefinitionsFactoryException
Fallback of several factory creation methods.
servletContext
- Servlet Context passed to newly created factory.factoryConfig
- Configuration object passed to factory.
DefinitionsFactoryException
- If an error occur while initializing factorypublic static ComponentDefinition getDefinition(java.lang.String definitionName, javax.servlet.ServletRequest request, javax.servlet.ServletContext servletContext) throws FactoryNotFoundException, DefinitionsFactoryException
definitionName
- Name of requested definition.request
- Current servelet request.servletContext
- current servlet context.
FactoryNotFoundException
- Can't find definition factory.
DefinitionsFactoryException
- General error in factory while getting definition.
NoSuchDefinitionException
- No definition found for specified nameprotected static void testReset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |