|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.struts2.views.velocity.VelocityManager
public class VelocityManager
Manages the environment for Velocity result types
Field Summary | |
---|---|
static String |
KEY_VELOCITY_STRUTS_CONTEXT
|
static String |
PARENT
the parent JSP tag |
static String |
STRUTS
|
static String |
TAG
the current JSP tag |
protected org.apache.velocity.tools.view.ToolboxManager |
toolboxManager
A reference to the toolbox manager. |
Constructor Summary | |
---|---|
VelocityManager()
|
Method Summary | |
---|---|
org.apache.velocity.context.Context |
createContext(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. |
protected void |
initToolbox(javax.servlet.ServletContext context)
Initializes the ServletToolboxManager for this servlet's toolbox (if any). |
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 |
protected org.apache.velocity.app.VelocityEngine |
newVelocityEngine(javax.servlet.ServletContext context)
Instantiates a new VelocityEngine. |
protected org.apache.velocity.VelocityContext[] |
prepareChainedContexts(javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
Map extraContext)
constructs contexts for chaining on this request. |
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(Container container)
|
void |
setCustomConfigFile(String val)
|
void |
setObjectFactory(ObjectFactory fac)
|
void |
setToolBoxLocation(String toolboxLocation)
|
void |
setVelocityProperties(Properties velocityProperties)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String STRUTS
public static final String KEY_VELOCITY_STRUTS_CONTEXT
public static final String PARENT
public static final String TAG
protected org.apache.velocity.tools.view.ToolboxManager toolboxManager
Constructor Detail |
---|
public VelocityManager()
Method Detail |
---|
public void setObjectFactory(ObjectFactory fac)
public void setContainer(Container container)
public org.apache.velocity.app.VelocityEngine getVelocityEngine()
public org.apache.velocity.context.Context createContext(ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
ValueStack
OgnlTool
StrutsUtil
protected org.apache.velocity.VelocityContext[] prepareChainedContexts(javax.servlet.http.HttpServletRequest servletRequest, javax.servlet.http.HttpServletResponse servletResponse, Map extraContext)
servletRequest
- servletResponse
- extraContext
-
public void init(javax.servlet.ServletContext context)
context
- the current servlet contextpublic Properties loadConfiguration(javax.servlet.ServletContext context)
context
- the current ServletContext. may not be null
public void setCustomConfigFile(String val)
public void setToolBoxLocation(String toolboxLocation)
public org.apache.velocity.tools.view.ToolboxManager getToolboxManager()
public void setChainedContexts(String contexts)
protected void initToolbox(javax.servlet.ServletContext context)
protected org.apache.velocity.app.VelocityEngine newVelocityEngine(javax.servlet.ServletContext context)
resource.loader = file, class file.resource.loader.path = real path of webapp class.resource.loader.description = Velocity Classpath Resource Loader class.resource.loader.class = org.apache.struts2.views.velocity.StrutsResourceLoaderthis default configuration can be overridden by specifying a struts.velocity.configfile property in the struts.properties file. the specified config file will be searched for in the following order:
context
- the current ServletContext. may not be nullpublic Properties getVelocityProperties()
public void setVelocityProperties(Properties velocityProperties)
velocityProperties
- the velocityProperties to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |