Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.struts2.views.gxp.AbstractGxpResult
`AbstractGxpResult.DefaultProvider, AbstractGxpResult.GxpResourceProvider`

Field Summary
`static String` | `DEFAULT_PARAM` Tells Struts 2 which parameter name to use if it's not already specified.

Constructor Summary
`GxpResult()`

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 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

### 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

Constructor Detail

### GxpResult

    public GxpResult()

Method Detail

### 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)

Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.