Class SingletonVelocityManager
java.lang.Object
com.atlassian.confluence.setup.struts.SingletonVelocityManager
- All Implemented Interfaces:
org.apache.struts2.views.velocity.VelocityManagerInterface
public class SingletonVelocityManager
extends Object
implements org.apache.struts2.views.velocity.VelocityManagerInterface
Struts uses a Guice container to manage its beans, the VelocityManager being one of them. Currently, the container
and Struts package configuration are coupled. That is, there is no way to reload the package configuration without
also reloading the container.
Confluence requires the Struts package configuration to be reloaded when plugins are installed and uninstalled. This
is problematic as the VelocityManager and its configuration should remain constant during the Confluence application
lifecycle. This delegating VelocityManager addresses this issue. See struts.velocity.manager.classname
in
struts.xml
.
- Since:
- 8.8
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.velocity.context.Context
createContext
(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) org.apache.velocity.app.VelocityEngine
void
init
(javax.servlet.ServletContext context)
-
Constructor Details
-
SingletonVelocityManager
public SingletonVelocityManager()
-
-
Method Details
-
getVelocityEngine
public org.apache.velocity.app.VelocityEngine getVelocityEngine()- Specified by:
getVelocityEngine
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-
createContext
public org.apache.velocity.context.Context createContext(com.opensymphony.xwork2.util.ValueStack stack, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) - Specified by:
createContext
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-
init
public void init(javax.servlet.ServletContext context) - Specified by:
init
in interfaceorg.apache.struts2.views.velocity.VelocityManagerInterface
-