com.opensymphony.webwork.views.tiles
Class TilesResult
java.lang.Object
com.opensymphony.webwork.dispatcher.WebWorkResultSupport
com.opensymphony.webwork.dispatcher.ServletDispatcherResult
com.opensymphony.webwork.views.tiles.TilesResult
- All Implemented Interfaces:
- WebWorkStatics, Result, Serializable
public class TilesResult
- extends ServletDispatcherResult
Renders a view using struts-tiles.
In your web.xml file, you need to add a servlet entry for TilesServlet to load the tiles definitions into the ServletContext.
tiles
org.apache.tiles.servlets.TilesServlet
definitions-config
/WEB-INF/tiles-config.xml
1
In xwork.xml, use type="tiles" on your .
userForm
userList
Making this result type the default for the current package.
- Version:
- $Id: TilesResult.java 2207 2006-02-17 19:06:03Z rainerh $
- Author:
- Matt Raible, Rainer Hermanns
- See Also:
- Serialized Form
Method Summary |
protected Locale |
deduceLocale(HttpServletRequest request)
|
void |
doExecute(String location,
ActionInvocation invocation)
Dispatches to the given location. |
protected void |
executeController(org.apache.struts.tiles.Controller controller,
org.apache.struts.tiles.ComponentContext context,
HttpServletRequest request,
HttpServletResponse response)
Execute the given Tiles controller. |
protected org.apache.struts.tiles.ComponentContext |
getComponentContext(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
Determine the Tiles component context for the given Tiles definition. |
protected org.apache.struts.tiles.ComponentDefinition |
getComponentDefinition(org.apache.struts.tiles.DefinitionsFactory factory,
HttpServletRequest request)
Determine the Tiles component definition for the given Tiles
definitions factory. |
protected org.apache.struts.tiles.Controller |
getController(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
Determine and initialize the Tiles component controller for the
given Tiles definition, if any. |
protected String |
getDispatcherPath(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
Determine the dispatcher path for the given Tiles definition,
i.e. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
invocation
protected ActionInvocation invocation
TilesResult
public TilesResult()
doExecute
public void doExecute(String location,
ActionInvocation invocation)
throws Exception
- Dispatches to the given location. Does its forward via a RequestDispatcher. If the
dispatch fails a 404 error will be sent back in the http response.
- Overrides:
doExecute
in class ServletDispatcherResult
- Parameters:
location
- the location to dispatch to.invocation
- the execution state of the action
- Throws:
Exception
- if an error occurs. If the dispatch fails the error will go back via the
HTTP request.
deduceLocale
protected Locale deduceLocale(HttpServletRequest request)
getComponentDefinition
protected org.apache.struts.tiles.ComponentDefinition getComponentDefinition(org.apache.struts.tiles.DefinitionsFactory factory,
HttpServletRequest request)
throws Exception
- Determine the Tiles component definition for the given Tiles
definitions factory.
- Parameters:
factory
- the Tiles definitions factoryrequest
- current HTTP request
- Returns:
- the component definition
- Throws:
Exception
getComponentContext
protected org.apache.struts.tiles.ComponentContext getComponentContext(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
throws Exception
- Determine the Tiles component context for the given Tiles definition.
- Parameters:
definition
- the Tiles definition to renderrequest
- current HTTP request
- Returns:
- the component context
- Throws:
Exception
- if preparations failed
getController
protected org.apache.struts.tiles.Controller getController(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
throws Exception
- Determine and initialize the Tiles component controller for the
given Tiles definition, if any.
- Parameters:
definition
- the Tiles definition to renderrequest
- current HTTP request
- Returns:
- the component controller to execute, or
null
if none
- Throws:
Exception
- if preparations failed
executeController
protected void executeController(org.apache.struts.tiles.Controller controller,
org.apache.struts.tiles.ComponentContext context,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
- Execute the given Tiles controller.
- Parameters:
controller
- the component controller to executecontext
- the component contextrequest
- current HTTP requestresponse
- current HTTP response
- Throws:
Exception
- if controller execution failed
getDispatcherPath
protected String getDispatcherPath(org.apache.struts.tiles.ComponentDefinition definition,
HttpServletRequest request)
throws Exception
- Determine the dispatcher path for the given Tiles definition,
i.e. the request dispatcher path of the layout page.
- Parameters:
definition
- the Tiles definition to renderrequest
- current HTTP request
- Returns:
- the path of the layout page to render
- Throws:
Exception
- if preparations failed