com.atlassian.jira.util.velocity
Class SimpleVelocityRequestContext

java.lang.Object
  extended by com.atlassian.jira.util.velocity.SimpleVelocityRequestContext
All Implemented Interfaces:
VelocityRequestContext

public class SimpleVelocityRequestContext
extends Object
implements VelocityRequestContext

Default implementation

See Also:
VelocityRequestContext

Constructor Summary
SimpleVelocityRequestContext(String baseUrl)
           
SimpleVelocityRequestContext(String baseUrl, String canonicalBaseUrl, RequestContextParameterHolder requestContextParameterHolder, VelocityRequestSession session)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleVelocityRequestContext

public SimpleVelocityRequestContext(String baseUrl)

SimpleVelocityRequestContext

public SimpleVelocityRequestContext(String baseUrl,
                                    String canonicalBaseUrl,
                                    RequestContextParameterHolder requestContextParameterHolder,
                                    VelocityRequestSession session)
Method Detail

getBaseUrl

public String getBaseUrl()
Specified by:
getBaseUrl in interface VelocityRequestContext
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/").
See Also:
VelocityRequestContext.getBaseUrl()

getCanonicalBaseUrl

public String getCanonicalBaseUrl()
Specified by:
getCanonicalBaseUrl in interface VelocityRequestContext
Returns:
The canonical base URL for this instance. It will return an absolute URL (eg. "http://example.com/jira/").

getRequestParameters

public RequestContextParameterHolder getRequestParameters()
Description copied from interface: VelocityRequestContext
Returns a RequestContextParameterHolder with various HttpServletRequest parameters. This will be null if no HttpRequest is available.

Specified by:
getRequestParameters in interface VelocityRequestContext
Returns:
Null if no HttpRequest is available. RequestContextParameterHolder with various parameters otherwise
See Also:
VelocityRequestContext.getRequestParameters()

getRequestParameter

public String getRequestParameter(String name)
Description copied from interface: VelocityRequestContext
Convenience method to return the value from the requestParameter map stored with the name parameter.

Specified by:
getRequestParameter in interface VelocityRequestContext
Parameters:
name - parameter name
Returns:
parameter value, or null

getSession

public VelocityRequestSession getSession()
Description copied from interface: VelocityRequestContext
Retrieve the VelocityRequestSession for the current user. This will be null if you did not come in through a Http Request

Specified by:
getSession in interface VelocityRequestContext
Returns:
null if no session is available


Copyright © 2002-2014 Atlassian. All Rights Reserved.