Class ConfluenceVelocityManager
java.lang.Object
com.atlassian.confluence.setup.struts.ConfluenceVelocityManager
- All Implemented Interfaces:
org.apache.struts2.views.velocity.VelocityManager
public class ConfluenceVelocityManager
extends Object
implements org.apache.struts2.views.velocity.VelocityManager
Lightweight variant of the Struts VelocityManager. Responsible for reading and loading configuration
in order to initialise the Velocity engine, as well as constructing rendering contexts.
createContext(org.apache.struts2.util.ValueStack, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)is called to construct a context for rendering Struts Velocity Results and SiteMesh decoratorsgetConfluenceVelocityContext()can be called to construct a base context for other rendering purposes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.velocity.context.ContextcreateContext(org.apache.struts2.util.ValueStack stack, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Constructs a Velocity rendering context for use by Struts Velocity Results and SiteMesh decorators.static org.apache.velocity.context.ContextConstructs a base Velocity rendering context for other rendering purposes such as Confluence Macros.org.apache.velocity.app.VelocityEnginevoidinit(jakarta.servlet.ServletContext context) static org.apache.velocity.context.ContextprocessContextForRendering(org.apache.velocity.context.Context context)
-
Constructor Details
-
ConfluenceVelocityManager
public ConfluenceVelocityManager()
-
-
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 request, jakarta.servlet.http.HttpServletResponse response) Constructs a Velocity rendering context for use by Struts Velocity Results and SiteMesh decorators.- Specified by:
createContextin interfaceorg.apache.struts2.views.velocity.VelocityManager
-
getConfluenceVelocityContext
public static org.apache.velocity.context.Context getConfluenceVelocityContext()Constructs a base Velocity rendering context for other rendering purposes such as Confluence Macros. This differs fromcreateContext(org.apache.struts2.util.ValueStack, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse)in that it does not return aStrutsVelocityContextwhich exhibitsValueStacklookup fallback. -
init
public void init(jakarta.servlet.ServletContext context) - Specified by:
initin interfaceorg.apache.struts2.views.velocity.VelocityManager
-
processContextForRendering
public static org.apache.velocity.context.Context processContextForRendering(org.apache.velocity.context.Context context) - Parameters:
context- is currently modified and returned, but do not rely on this as it may change in future.
-