|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.dispatcher.StrutsResultSupport
org.apache.struts2.dispatcher.ServletDispatcherResult
org.apache.struts2.views.tiles.TilesResult
public class TilesResult
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. <servlet> <servlet-name>tiles</servlet-name> <servlet-class>org.apache.tiles.servlets.TilesServlet</servlet-class> <init-param> <param-name>definitions-config</param-name> <param-value>/WEB-INF/tiles-config.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> 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>
Field Summary | |
---|---|
protected com.opensymphony.xwork2.ActionInvocation |
invocation
|
Fields inherited from class org.apache.struts2.dispatcher.StrutsResultSupport |
---|
DEFAULT_PARAM |
Fields inherited from interface org.apache.struts2.StrutsStatics |
---|
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_PORTLET_CONTEXT |
Constructor Summary | |
---|---|
TilesResult()
|
|
TilesResult(java.lang.String location)
|
Method Summary | |
---|---|
protected java.util.Locale |
deduceLocale(javax.servlet.http.HttpServletRequest request)
|
void |
doExecute(java.lang.String location,
com.opensymphony.xwork2.ActionInvocation invocation)
Dispatches to the given location. |
protected void |
executeController(org.apache.tiles.Controller controller,
org.apache.tiles.ComponentContext context,
org.apache.tiles.TilesContext tilesContext)
Execute the given Tiles controller. |
protected org.apache.tiles.ComponentContext |
getComponentContext(org.apache.tiles.ComponentDefinition definition,
org.apache.tiles.TilesContext tilesContext)
Determine the Tiles component context for the given Tiles definition. |
protected org.apache.tiles.ComponentDefinition |
getComponentDefinition(java.lang.String location,
org.apache.tiles.DefinitionsFactory factory,
javax.servlet.http.HttpServletRequest request)
Determine the Tiles component definition for the given Tiles definitions factory. |
protected org.apache.tiles.Controller |
getController(org.apache.tiles.ComponentDefinition definition,
javax.servlet.http.HttpServletRequest request)
Determine and initialize the Tiles component controller for the given Tiles definition, if any. |
protected java.lang.String |
getDispatcherPath(org.apache.tiles.ComponentDefinition definition,
javax.servlet.http.HttpServletRequest request)
Determine the dispatcher path for the given Tiles definition, i.e. |
Methods inherited from class org.apache.struts2.dispatcher.StrutsResultSupport |
---|
conditionalParse, execute, getLastFinalLocation, setEncode, setLocation, setParse |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected com.opensymphony.xwork2.ActionInvocation invocation
Constructor Detail |
---|
public TilesResult()
public TilesResult(java.lang.String location)
Method Detail |
---|
public void doExecute(java.lang.String location, com.opensymphony.xwork2.ActionInvocation invocation) throws java.lang.Exception
doExecute
in class org.apache.struts2.dispatcher.ServletDispatcherResult
location
- the location to dispatch to.invocation
- the execution state of the action
java.lang.Exception
- if an error occurs. If the dispatch fails the error will go back via the
HTTP request.protected java.util.Locale deduceLocale(javax.servlet.http.HttpServletRequest request)
protected org.apache.tiles.ComponentDefinition getComponentDefinition(java.lang.String location, org.apache.tiles.DefinitionsFactory factory, javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
factory
- the Tiles definitions factoryrequest
- current HTTP request
java.lang.Exception
protected org.apache.tiles.ComponentContext getComponentContext(org.apache.tiles.ComponentDefinition definition, org.apache.tiles.TilesContext tilesContext) throws java.lang.Exception
definition
- the Tiles definition to rendertilesContext
- current TilesContext
java.lang.Exception
- if preparations failedprotected org.apache.tiles.Controller getController(org.apache.tiles.ComponentDefinition definition, javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
definition
- the Tiles definition to renderrequest
- current HTTP request
null
if none
java.lang.Exception
- if preparations failedprotected void executeController(org.apache.tiles.Controller controller, org.apache.tiles.ComponentContext context, org.apache.tiles.TilesContext tilesContext) throws java.lang.Exception
controller
- the component controller to executecontext
- the component contexttilesContext
- current tilesContext
java.lang.Exception
- if controller execution failedprotected java.lang.String getDispatcherPath(org.apache.tiles.ComponentDefinition definition, javax.servlet.http.HttpServletRequest request) throws java.lang.Exception
definition
- the Tiles definition to renderrequest
- current HTTP request
java.lang.Exception
- if preparations failed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |