org.apache.struts2.views.gxp
Class AbstractGxpResult
java.lang.Object
org.apache.struts2.views.gxp.AbstractGxpResult
- All Implemented Interfaces:
- com.opensymphony.xwork2.Result, Serializable
- Direct Known Subclasses:
- GxpResult
public abstract class AbstractGxpResult
- extends Object
- implements com.opensymphony.xwork2.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:
- Implement
execute(ActionInvocation)
, which must instruct the
GXP to write itself to the output stream. See GxpResult
for a
sample implementation.
- 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-types>
<result-type name="gxp" class="org.apache.struts2.views.gxp.GxpResult">
<param name="useInstances">true</param>
</result-type>
</result-types>
This means that Struts 2 will attempt to instantiate the Interface
using the ObjectFactory
. If
com.google.webwork.GuiceWebWorkIntegrationModule
is installed, or
com.google.webwork.ContainerObjectFactory
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.
- Author:
- Bob Lee
- See Also:
- Serialized Form
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 |
execute |
AbstractGxpResult
public AbstractGxpResult()
setGxpName
public void setGxpName(String gxpName)
getGxpName
protected final String getGxpName()
setUseInstances
public void setUseInstances(boolean useInstances)
getUseInstances
protected final boolean getUseInstances()
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.