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.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    static org.apache.velocity.context.Context
    Constructs a base Velocity rendering context for other rendering purposes such as Confluence Macros.
    org.apache.velocity.app.VelocityEngine
     
    void
    init(jakarta.servlet.ServletContext context)
     
    static org.apache.velocity.context.Context
    processContextForRendering(org.apache.velocity.context.Context context)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConfluenceVelocityManager

      public ConfluenceVelocityManager()
  • Method Details

    • getVelocityEngine

      public org.apache.velocity.app.VelocityEngine getVelocityEngine()
      Specified by:
      getVelocityEngine in interface org.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:
      createContext in interface org.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 from createContext(org.apache.struts2.util.ValueStack, jakarta.servlet.http.HttpServletRequest, jakarta.servlet.http.HttpServletResponse) in that it does not return a StrutsVelocityContext which exhibits ValueStack lookup fallback.
    • init

      public void init(jakarta.servlet.ServletContext context)
      Specified by:
      init in interface org.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.