public interface

VelocityRequestContext

com.atlassian.jira.util.velocity.VelocityRequestContext
Known Indirect Subclasses

Class Overview

A context that allows for different implementations depending on whether it is running in the scope of a web request, or via email.

Summary

Public Methods
String getBaseUrl()
String getCanonicalBaseUrl()
String getRequestParameter(String name)
Convenience method to return the value from the requestParameter map stored with the name parameter.
RequestContextParameterHolder getRequestParameters()
Returns a RequestContextParameterHolder with various HttpServletRequest parameters.
VelocityRequestSession getSession()
Retrieve the VelocityRequestSession for the current user.

Public Methods

public 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.

public 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.

public 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

public 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

public VelocityRequestSession getSession ()

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