|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.struts.tiles.commands.TilesPreProcessor
public class TilesPreProcessor
Command class intended to perform responsibilities of the TilesRequestProcessor in Struts 1.1. Does not actually dispatch requests, but simply prepares the chain context for a later forward as appropriate. Should be added to a chain before something which would handle a conventional ForwardConfig.
This class will never have any effect on the chain unless a
TilesDefinitionFactory
can be found; however it does not
consider the absence of a definition factory to be a fatal error; the
command simply returns false and lets the chain continue.
To initialize the TilesDefinitionFactory
, use
org.apache.struts.chain.commands.legacy.TilesPlugin
. This class
is a simple extension to org.apache.struts.tiles.TilesPlugin
which simply does not interfere with your choice of RequestProcessor
implementation.
Field Summary |
---|
Fields inherited from interface org.apache.commons.chain.Command |
---|
CONTINUE_PROCESSING, PROCESSING_COMPLETE |
Constructor Summary | |
---|---|
TilesPreProcessor()
|
Method Summary | |
---|---|
protected void |
doForward(org.apache.struts.chain.contexts.ServletActionContext context,
java.lang.String uri)
Do an include of specified URI using a RequestDispatcher . |
protected void |
doInclude(org.apache.struts.chain.contexts.ServletActionContext context,
java.lang.String uri)
Do an include of specified URI using a RequestDispatcher . |
boolean |
execute(org.apache.commons.chain.Context context)
If the current ForwardConfig is using "tiles",
perform necessary pre-processing to set up the TilesContext
and substitute a new ForwardConfig which is understandable
to a RequestDispatcher . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TilesPreProcessor()
Method Detail |
---|
public boolean execute(org.apache.commons.chain.Context context) throws java.lang.Exception
If the current ForwardConfig
is using "tiles",
perform necessary pre-processing to set up the TilesContext
and substitute a new ForwardConfig
which is understandable
to a RequestDispatcher
.
Note that if the command finds a previously existing
ComponentContext
in the request, then it
infers that it has been called from within another tile,
so instead of changing the ForwardConfig
in the chain
Context
, the command uses RequestDispatcher
to include the tile, and returns true, indicating that the processing
chain is complete.
execute
in interface org.apache.commons.chain.Command
context
- The Context
for the current request
false
in most cases, but true if we determine
that we're processing in "include" mode.
java.lang.Exception
protected void doInclude(org.apache.struts.chain.contexts.ServletActionContext context, java.lang.String uri) throws java.io.IOException, javax.servlet.ServletException
Do an include of specified URI using a RequestDispatcher
.
context
- a chain servlet/web contexturi
- Context-relative URI to include
java.io.IOException
javax.servlet.ServletException
protected void doForward(org.apache.struts.chain.contexts.ServletActionContext context, java.lang.String uri) throws java.io.IOException, javax.servlet.ServletException
Do an include of specified URI using a RequestDispatcher
.
context
- a chain servlet/web contexturi
- Context-relative URI to include
java.io.IOException
javax.servlet.ServletException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |