Class AbstractGxpResult

  extended by org.apache.struts2.views.gxp.AbstractGxpResult
All Implemented Interfaces:
Direct Known Subclasses:

public abstract class AbstractGxpResult
extends java.lang.Object
implements Result

The abstract base class for our Struts 2 GXP result type implementation. It outputs GXP, and pulls GXP parameters from Struts 2's value stack. Implementing classes have to:

  1. Implement execute(ActionInvocation), which must instruct the GXP to write itself to the output stream. See GxpResult for a sample implementation.
  2. Add a public static final field DEFAULT_PARAM with the value 'gxpName'. Struts 2 needs this to set the name of your template into this object.

If you want to use instantiated GXPs (using the nested Interface), you can set the useuseInstances parameter to true:

       <result-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult">
         <param name="useInstances">true</param>
This means that Struts 2 will attempt to instantiate the Interface using the ObjectFactory. If is installed, or is set as the static ObjectFactory instance, then Guice will be used to instantiate the GXP instance; otherwise, only GXPs with no constructor parameters will work.

Bob Lee
See Also:
Serialized Form

Nested Class Summary
protected static class AbstractGxpResult.DefaultProvider
          Uses reasonable defaults to provide resources.
protected static interface AbstractGxpResult.GxpResourceProvider
          Provides resources necessary to execute a GXP.
Constructor Summary
Method Summary
protected  java.lang.String getGxpName()
protected  boolean getUseInstances()
 void setGxpName(java.lang.String gxpName)
 void setUseInstances(boolean useInstances)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.opensymphony.xwork2.Result

Constructor Detail


public AbstractGxpResult()
Method Detail


public void setGxpName(java.lang.String gxpName)


protected final java.lang.String getGxpName()


public void setUseInstances(boolean useInstances)


protected final boolean getUseInstances()

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