Class GxpResult

  extended by org.apache.struts2.views.gxp.AbstractGxpResult
      extended by org.apache.struts2.views.gxp.GxpResult
All Implemented Interfaces:

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-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult"/>

Or if you want to output XML instead of HTML:

       <result-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult">
         <param name="outputXml">true</param>

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>

Bob Lee
See Also:
AbstractGxpResult, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from class org.apache.struts2.views.gxp.AbstractGxpResult
AbstractGxpResult.DefaultProvider, AbstractGxpResult.GxpResourceProvider
Field Summary
static java.lang.String DEFAULT_PARAM
          Tells Struts 2 which parameter name to use if it's not already specified.
Constructor Summary
Method Summary
 void execute(ActionInvocation actionInvocation)
          Tells the GXP to write itself to the output stream.
protected getGxpClosure()
 void setContainer(Container container)
 void setOutputXml(boolean outputXml)
          Whether or not this GXP should output XML.
Methods inherited from class org.apache.struts2.views.gxp.AbstractGxpResult
getGxpName, getUseInstances, setGxpName, setUseInstances
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


public static final java.lang.String DEFAULT_PARAM
Tells Struts 2 which parameter name to use if it's not already specified.

See Also:
Constant Field Values
Constructor Detail


public GxpResult()
Method Detail


public void setOutputXml(boolean outputXml)
Whether or not this GXP should output XML.


protected getGxpClosure()


public void execute(ActionInvocation actionInvocation)
Tells the GXP to write itself to the output stream.


public void setContainer(Container container)

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.