org.apache.struts2.views.velocity
类 VelocityManager

java.lang.Object
  继承者 org.apache.struts2.views.velocity.VelocityManager

public class VelocityManager
extends Object

Manages the environment for Velocity result types


字段摘要
static String KEY_VELOCITY_STRUTS_CONTEXT
           
static String PARENT
          the parent JSP tag
static String STRUTS
           
static String TAG
          the current JSP tag
 
构造方法摘要
VelocityManager()
           
 
方法摘要
 org.apache.velocity.context.Context createContext(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          This method is responsible for creating the standard VelocityContext used by all WW2 velocity views.
 org.apache.velocity.tools.view.ToolboxManager getToolboxManager()
           
 org.apache.velocity.app.VelocityEngine getVelocityEngine()
           
 Properties getVelocityProperties()
           
 void init(javax.servlet.ServletContext context)
          initializes the VelocityManager.
 Properties loadConfiguration(javax.servlet.ServletContext context)
          load optional velocity properties using the following loading strategy relative to the servlet context path relative to the WEB-INF directory on the classpath
 void setChainedContexts(String contexts)
          allow users to specify via the struts.properties file a set of additional VelocityContexts to chain to the the StrutsVelocityContext.
 void setContainer(com.opensymphony.xwork2.inject.Container container)
           
 void setCustomConfigFile(String val)
           
 void setObjectFactory(com.opensymphony.xwork2.ObjectFactory fac)
           
 void setToolBoxLocation(String toolboxLocation)
           
 void setVelocityProperties(Properties velocityProperties)
           
 
从类 java.lang.Object 继承的方法
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

STRUTS

public static final String STRUTS
另请参见:
常量字段值

KEY_VELOCITY_STRUTS_CONTEXT

public static final String KEY_VELOCITY_STRUTS_CONTEXT
另请参见:
常量字段值

PARENT

public static final String PARENT
the parent JSP tag

另请参见:
常量字段值

TAG

public static final String TAG
the current JSP tag

另请参见:
常量字段值
构造方法详细信息

VelocityManager

public VelocityManager()
方法详细信息

setObjectFactory

public void setObjectFactory(com.opensymphony.xwork2.ObjectFactory fac)

setContainer

public void setContainer(com.opensymphony.xwork2.inject.Container container)

getVelocityEngine

public org.apache.velocity.app.VelocityEngine getVelocityEngine()
返回:
a reference to the VelocityEngine used by all struts velocity thingies with the exception of directly accessed *.vm pages

createContext

public org.apache.velocity.context.Context createContext(com.opensymphony.xwork2.util.ValueStack stack,
                                                         javax.servlet.http.HttpServletRequest req,
                                                         javax.servlet.http.HttpServletResponse res)
This method is responsible for creating the standard VelocityContext used by all WW2 velocity views. The following context parameters are defined:

返回:
a new StrutsVelocityContext

init

public void init(javax.servlet.ServletContext context)
initializes the VelocityManager. this should be called during the initialization process, say by ServletDispatcher. this may be called multiple times safely although calls beyond the first won't do anything

参数:
context - the current servlet context

loadConfiguration

public Properties loadConfiguration(javax.servlet.ServletContext context)
load optional velocity properties using the following loading strategy

参数:
context - the current ServletContext. may not be null
返回:
the optional properties if struts.velocity.configfile was specified, an empty Properties file otherwise

setCustomConfigFile

public void setCustomConfigFile(String val)

setToolBoxLocation

public void setToolBoxLocation(String toolboxLocation)

getToolboxManager

public org.apache.velocity.tools.view.ToolboxManager getToolboxManager()

setChainedContexts

public void setChainedContexts(String contexts)
allow users to specify via the struts.properties file a set of additional VelocityContexts to chain to the the StrutsVelocityContext. The intent is to allow these contexts to store helper objects that the ui developer may want access to. Examples of reasonable VelocityContexts would be an IoCVelocityContext, a SpringReferenceVelocityContext, and a ToolboxVelocityContext


getVelocityProperties

public Properties getVelocityProperties()
返回:
the velocityProperties

setVelocityProperties

public void setVelocityProperties(Properties velocityProperties)
参数:
velocityProperties - the velocityProperties to set