Interface VelocityRequestContext

All Known Implementing Classes:
SimpleVelocityRequestContext

public interface VelocityRequestContext
A context that allows for different implementations depending on whether it is running in the scope of a web request, or via email.
See Also:
  • Method Details

    • getBaseUrl

      String getBaseUrl()
      Returns:
      The base URL for this instance, also known as the context path. If running in the context of a web request, this will return a url relative to the server root (ie "/jira"). If running via email, it will return an absolute URL (eg. "http://example.com/jira"). In both cases URL does not contain trailing "/" character.
    • getCanonicalBaseUrl

      String getCanonicalBaseUrl()
      Returns:
      The canonical base URL for this instance. It will return an absolute URL (eg. "http://example.com/jira"). This URL does not econtain trailing "/" character.
    • getRequestParameters

      RequestContextParameterHolder getRequestParameters()
      Returns a RequestContextParameterHolder with various HttpServletRequest parameters. This will be null if no HttpRequest is available.
      Returns:
      Null if no HttpRequest is available. RequestContextParameterHolder with various parameters otherwise
    • getRequestParameter

      String getRequestParameter(String name)
      Convenience method to return the value from the requestParameter map stored with the name parameter.
      Parameters:
      name - parameter name
      Returns:
      parameter value, or null
      Since:
      v3.10
    • getSession

      Deprecated.
      since 7.1 Storing information on the HttpSession is not supported. Please move the functionality to the frontend or other type of storage. This class will be removed in 8.0.
      Retrieve the VelocityRequestSession for the current user.

      This will be null if you did not come in through a Http Request

      Returns:
      null if no session is available