org.apache.struts2.views.gxp
Class GxpResult
java.lang.Object
org.apache.struts2.views.gxp.AbstractGxpResult
org.apache.struts2.views.gxp.GxpResult
- All Implemented Interfaces:
- com.opensymphony.xwork2.Result, Serializable
public class GxpResult
- extends AbstractGxpResult
Struts 2 GXP result type implementation. Outputs GXP. Pulls GXP parameters
from Struts 2's value stack.
Declare the GXP result type for your package in the xwork.xml file:
<result-types>
<result-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult"/>
</result-types>
Or if you want to output XML instead of HTML:
<result-types>
<result-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult">
<param name="outputXml">true</param>
</result-type>
</result-types>
Outputting XML changes the content type from text/html to application/xml
and configures the GxpContext
to output XML. This is useful in
situations like specifying the doctype of your GXP to be 'mobile'.
Use the GXP result type for the result of an action. For example:
<result name="success" type="gxp">/myPackage/MyGxp.gxp</result>
- Author:
- Bob Lee
- See Also:
AbstractGxpResult
,
Serialized Form
Field Summary |
static String |
DEFAULT_PARAM
Tells Struts 2 which parameter name to use if it's not already specified. |
Method Summary |
void |
execute(com.opensymphony.xwork2.ActionInvocation actionInvocation)
Tells the GXP to write itself to the output stream. |
protected com.google.gxp.html.HtmlClosure |
getGxpClosure()
|
void |
setContainer(com.opensymphony.xwork2.inject.Container container)
|
void |
setOutputXml(boolean outputXml)
Whether or not this GXP should output XML. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_PARAM
public static final String DEFAULT_PARAM
- Tells Struts 2 which parameter name to use if it's not already specified.
- See Also:
- Constant Field Values
GxpResult
public GxpResult()
setOutputXml
public void setOutputXml(boolean outputXml)
- Whether or not this GXP should output XML.
getGxpClosure
protected com.google.gxp.html.HtmlClosure getGxpClosure()
execute
public void execute(com.opensymphony.xwork2.ActionInvocation actionInvocation)
- Tells the GXP to write itself to the output stream.
setContainer
public void setContainer(com.opensymphony.xwork2.inject.Container container)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.