public class TilesResult extends ServletDispatcherResult
<listener> <listener-class>org.apache.struts2.tiles.StrutsTilesListener</listener-class> </listener>
In struts.xml, use type="tiles" on your <result>.
<action name="editUser" class="userAction" method="edit"> <result name="success" type="tiles">userForm</result> <result name="input" type="tiles">userList</result> </action>
Making this result type the default for the current package.
<result-types> <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" default="true" /> </result-types>
You have to configure tiles itself. Therefore you can add tiles.xml
either
to resources or WEB-INF. You may also use annotations like TilesDefinition
.
DEFAULT_PARAM, DEFAULT_URL_ENCODING, parseLocation
ACTION_MAPPING, HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
Constructor and Description |
---|
TilesResult() |
TilesResult(String location) |
Modifier and Type | Method and Description |
---|---|
void |
doExecute(String location,
ActionInvocation invocation)
Dispatches to the given location.
|
getParameters, setQueryStringParser
conditionalParse, conditionalParseCollection, execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse
public TilesResult()
public TilesResult(String location)
public void doExecute(String location, ActionInvocation invocation) throws Exception
doExecute
in class ServletDispatcherResult
location
- the location to dispatch to.invocation
- the execution state of the actionException
- if an error occurs. If the dispatch fails the error will go back via the
HTTP request.Copyright © 2000–2024 Apache Software Foundation. All rights reserved.