org.apache.struts2.dispatcher
类 VelocityResult

java.lang.Object
  继承者 org.apache.struts2.dispatcher.StrutsResultSupport
      继承者 org.apache.struts2.dispatcher.VelocityResult
所有已实现的接口:
com.opensymphony.xwork2.Result, Serializable, StrutsStatics

public class VelocityResult
extends StrutsResultSupport

Using the Servlet container's JspFactory, this result mocks a JSP execution environment and then displays a Velocity template that will be streamed directly to the servlet output.

This result type takes the following parameters:

This result follows the same rules from StrutsResultSupport.

Example:

 <result name="success" type="velocity">
   <param name="location">foo.vm</param>
 </result>
 

另请参见:
序列化表格

字段摘要
 
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的字段
DEFAULT_PARAM
 
从接口 org.apache.struts2.StrutsStatics 继承的字段
HTTP_REQUEST, HTTP_RESPONSE, PAGE_CONTEXT, SERVLET_CONTEXT, SERVLET_DISPATCHER, STRUTS_ACTION_TAG_INVOCATION, STRUTS_PORTLET_CONTEXT
 
构造方法摘要
VelocityResult()
           
VelocityResult(String location)
           
 
方法摘要
 void doExecute(String finalLocation, com.opensymphony.xwork2.ActionInvocation invocation)
          Creates a Velocity context from the action, loads a Velocity template and executes the template.
 void setDefaultEncoding(String val)
           
 void setVelocityManager(VelocityManager mgr)
           
 
从类 org.apache.struts2.dispatcher.StrutsResultSupport 继承的方法
execute, getLastFinalLocation, getLocation, setEncode, setLocation, setParse
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

VelocityResult

public VelocityResult()

VelocityResult

public VelocityResult(String location)
方法详细信息

setDefaultEncoding

public void setDefaultEncoding(String val)

setVelocityManager

public void setVelocityManager(VelocityManager mgr)

doExecute

public void doExecute(String finalLocation,
                      com.opensymphony.xwork2.ActionInvocation invocation)
               throws Exception
Creates a Velocity context from the action, loads a Velocity template and executes the template. Output is written to the servlet output stream.

参数:
finalLocation - the location of the Velocity template
invocation - an encapsulation of the action execution state.
抛出:
Exception - if an error occurs when creating the Velocity context, loading or executing the template or writing output to the servlet response stream.