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>
AbstractGxpResult
,
Serialized FormAbstractGxpResult.DefaultProvider, AbstractGxpResult.GxpResourceProvider
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PARAM
Tells Struts 2 which parameter name to use if it's not already specified.
|
Constructor and Description |
---|
GxpResult() |
Modifier and Type | Method and Description |
---|---|
void |
execute(ActionInvocation actionInvocation)
Tells the GXP to write itself to the output stream.
|
protected com.google.gxp.html.HtmlClosure |
getGxpClosure() |
void |
setContainer(Container container) |
void |
setOutputXml(boolean outputXml)
Whether or not this GXP should output XML.
|
getGxpName, getUseInstances, setGxpName, setUseInstances
public static final String DEFAULT_PARAM
public void setOutputXml(boolean outputXml)
outputXml
- set the output XMLprotected com.google.gxp.html.HtmlClosure getGxpClosure()
public void execute(ActionInvocation actionInvocation)
actionInvocation
- the action invocationpublic void setContainer(Container container)
Copyright © 2000–2020 Apache Software Foundation. All rights reserved.