Package com.atlassian.jira.util.velocity
Class SimpleVelocityRequestContext
java.lang.Object
com.atlassian.jira.util.velocity.SimpleVelocityRequestContext
- All Implemented Interfaces:
VelocityRequestContext
Default implementation
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleVelocityRequestContext(String baseUrl) SimpleVelocityRequestContext(String baseUrl, String canonicalBaseUrl, RequestContextParameterHolder requestContextParameterHolder, VelocityRequestSession session) -
Method Summary
Modifier and TypeMethodDescriptiongetRequestParameter(String name) Convenience method to return the value from the requestParameter map stored with the name parameter.Returns a RequestContextParameterHolder with various HttpServletRequest parameters.Retrieve theVelocityRequestSessionfor the current user.
-
Constructor Details
-
SimpleVelocityRequestContext
-
SimpleVelocityRequestContext
public SimpleVelocityRequestContext(String baseUrl, String canonicalBaseUrl, RequestContextParameterHolder requestContextParameterHolder, VelocityRequestSession session)
-
-
Method Details
-
getBaseUrl
- Specified by:
getBaseUrlin interfaceVelocityRequestContext- 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.
- See Also:
-
getCanonicalBaseUrl
- Specified by:
getCanonicalBaseUrlin interfaceVelocityRequestContext- 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
Description copied from interface:VelocityRequestContextReturns a RequestContextParameterHolder with various HttpServletRequest parameters. This will be null if no HttpRequest is available.- Specified by:
getRequestParametersin interfaceVelocityRequestContext- Returns:
- Null if no HttpRequest is available. RequestContextParameterHolder with various parameters otherwise
- See Also:
-
getRequestParameter
Description copied from interface:VelocityRequestContextConvenience method to return the value from the requestParameter map stored with the name parameter.- Specified by:
getRequestParameterin interfaceVelocityRequestContext- Parameters:
name- parameter name- Returns:
- parameter value, or null
-
getSession
Description copied from interface:VelocityRequestContextRetrieve theVelocityRequestSessionfor the current user.This will be null if you did not come in through a Http Request
- Specified by:
getSessionin interfaceVelocityRequestContext- Returns:
- null if no session is available
-