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 java.lang.Object
implements VelocityRequestContext

Default implementation

See Also:
VelocityRequestContext

Constructor Summary
SimpleVelocityRequestContext(java.lang.String baseUrl)
           
SimpleVelocityRequestContext(java.lang.String baseUrl, java.lang.String canonicalBaseUrl, RequestContextParameterHolder requestContextParameterHolder, VelocityRequestSession session)
           
 
Method Summary
 java.lang.String getBaseUrl()
           
 java.lang.String getCanonicalBaseUrl()
           
 java.lang.String getRequestParameter(java.lang.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(java.lang.String baseUrl)

SimpleVelocityRequestContext

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

getBaseUrl

public java.lang.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 java.lang.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 java.lang.String getRequestParameter(java.lang.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-2010 Atlassian. All Rights Reserved.