Class SingletonVelocityManager
java.lang.Object
com.atlassian.confluence.setup.struts.SingletonVelocityManager
- All Implemented Interfaces:
org.apache.struts2.views.velocity.VelocityManager
public class SingletonVelocityManager
extends Object
implements org.apache.struts2.views.velocity.VelocityManager
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.ContextcreateContext(org.apache.struts2.util.ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) org.apache.velocity.app.VelocityEnginevoidinit(jakarta.servlet.ServletContext context)
-
Constructor Details
-
SingletonVelocityManager
public SingletonVelocityManager()
-
-
Method Details
-
getVelocityEngine
public org.apache.velocity.app.VelocityEngine getVelocityEngine()- Specified by:
getVelocityEnginein interfaceorg.apache.struts2.views.velocity.VelocityManager
-
createContext
public org.apache.velocity.context.Context createContext(org.apache.struts2.util.ValueStack stack, jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse res) - Specified by:
createContextin interfaceorg.apache.struts2.views.velocity.VelocityManager
-
init
public void init(jakarta.servlet.ServletContext context) - Specified by:
initin interfaceorg.apache.struts2.views.velocity.VelocityManager
-