org.apache.tiles
Interface TilesContainer

Package class diagram package TilesContainer
All Known Subinterfaces:
MutableTilesContainer

public interface TilesContainer

An encapsulation of the tiles framework. This interface is used to expose tiles features to frameworks which leverage it as a plugin. It can alternately be used by web applications which would like a programmatic interface.

Since:
2.0

Method Summary
 void endContext(java.lang.Object request, java.lang.Object response)
          Ends a context, where attribute values are stored independently from others.
It must be called after a startContext(Object, Object) call.
 void endContext(javax.servlet.jsp.PageContext context)
          Ends a context, where attribute values are stored independently from others.
It must be called after a startContext(PageContext) call.
 TilesApplicationContext getApplicationContext()
          Retrieve the containers context.
 ComponentContext getComponentContext(java.lang.Object request, java.lang.Object response)
          Retrive the component context of the current request.
 ComponentContext getComponentContext(javax.servlet.jsp.PageContext context)
          Retrieve the component context of the current request
 void init(java.util.Map<java.lang.String,java.lang.String> initParameters)
          Initialize the container with the given configuration.
 boolean isValidDefinition(java.lang.Object request, java.lang.Object response, java.lang.String definition)
          Determine whether or not the definition exists.
 boolean isValidDefinition(javax.servlet.jsp.PageContext pageContext, java.lang.String definition)
          Determine whether or not the definition exists.
 void prepare(java.lang.Object request, java.lang.Object response, java.lang.String definition)
           
 void prepare(javax.servlet.jsp.PageContext pageContext, java.lang.String definition)
           
 void render(java.lang.Object request, java.lang.Object response, java.lang.String definition)
          Render the given tiles request
 void render(javax.servlet.jsp.PageContext pageContext, ComponentAttribute attribute)
          Render the given ComponentAttribute.
 void render(javax.servlet.jsp.PageContext pageContext, java.lang.String definition)
           
 ComponentContext startContext(java.lang.Object request, java.lang.Object response)
          Starts a new context, where attribute values are stored independently from others.
When the use of the contexts is finished, call endContext(Object, Object)
 ComponentContext startContext(javax.servlet.jsp.PageContext context)
          Starts a new context, where attribute values are stored independently from others.
When the use of the contexts is finished, call endContext(PageContext)
 

Method Detail

init

void init(java.util.Map<java.lang.String,java.lang.String> initParameters)
          throws TilesException
Initialize the container with the given configuration.

Parameters:
initParameters - application context
Throws:
TilesException - when an initialization error occurs

getApplicationContext

TilesApplicationContext getApplicationContext()
Retrieve the containers context.

Returns:
current application context

getComponentContext

ComponentContext getComponentContext(java.lang.Object request,
                                     java.lang.Object response)
Retrive the component context of the current request.

Parameters:
request - the current request.
response - the current reponse.
Returns:
map of the attributes in the current component context.

getComponentContext

ComponentContext getComponentContext(javax.servlet.jsp.PageContext context)
Retrieve the component context of the current request

Parameters:
context - the current request.
Returns:
map of the attributes in the current component context.

startContext

ComponentContext startContext(java.lang.Object request,
                              java.lang.Object response)
Starts a new context, where attribute values are stored independently from others.
When the use of the contexts is finished, call endContext(Object, Object)

Parameters:
request - the current request.
response - the current reponse.
Returns:
The newly created context.

startContext

ComponentContext startContext(javax.servlet.jsp.PageContext context)
Starts a new context, where attribute values are stored independently from others.
When the use of the contexts is finished, call endContext(PageContext)

Parameters:
context - the current request.
Returns:
The newly created context.

endContext

void endContext(java.lang.Object request,
                java.lang.Object response)
Ends a context, where attribute values are stored independently from others.
It must be called after a startContext(Object, Object) call.

Parameters:
request - the current request.
response - the current reponse.

endContext

void endContext(javax.servlet.jsp.PageContext context)
Ends a context, where attribute values are stored independently from others.
It must be called after a startContext(PageContext) call.

Parameters:
context - the current request.

prepare

void prepare(java.lang.Object request,
             java.lang.Object response,
             java.lang.String definition)
             throws TilesException
Parameters:
request - the current request
response - the current response
definition - the requested definition
Throws:
TilesException - is processing fails.

prepare

void prepare(javax.servlet.jsp.PageContext pageContext,
             java.lang.String definition)
             throws TilesException
Parameters:
pageContext - the current pageContext
definition - the current definition
Throws:
TilesException - is processing fails.

render

void render(java.lang.Object request,
            java.lang.Object response,
            java.lang.String definition)
            throws TilesException
Render the given tiles request

Parameters:
request - the current request
response - the current response
definition - the current definition
Throws:
TilesException - is processing fails.

render

void render(javax.servlet.jsp.PageContext pageContext,
            java.lang.String definition)
            throws TilesException
Parameters:
pageContext - the current pageContext.
definition - the requested definition.
Throws:
TilesException - is processing fails.

render

void render(javax.servlet.jsp.PageContext pageContext,
            ComponentAttribute attribute)
            throws TilesException,
                   java.io.IOException
Render the given ComponentAttribute.

Parameters:
pageContext -
attribute -
Throws:
TilesException
java.io.IOException

isValidDefinition

boolean isValidDefinition(javax.servlet.jsp.PageContext pageContext,
                          java.lang.String definition)
Determine whether or not the definition exists.

Parameters:
pageContext - the current page context
definition - the name of the definition.
Returns:
true if the definition is found.

isValidDefinition

boolean isValidDefinition(java.lang.Object request,
                          java.lang.Object response,
                          java.lang.String definition)
Determine whether or not the definition exists.

Parameters:
request - the current request
response - the current response
definition - the name of the definition.
Returns:
true if the definition is found.