|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RequestHelper
RequestHelper
represents a helper instance for http requests.
Method Summary | |
---|---|
java.lang.String |
getCookieValue(javax.servlet.http.HttpServletRequest request,
java.lang.String cookieName)
Returns the value of a cookie with the specified name. |
ElasticPath |
getElasticPath()
Get the ElasticPath singleton. |
int |
getIntParameterOrAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
int defaultVal)
Get an int parameter or attribute, with a fallback value. |
java.lang.Long |
getLongParameter(javax.servlet.http.HttpServletRequest request,
java.lang.String parameterName)
Retrieve the given parameter as Long from the given request. |
ShoppingCart |
getShoppingCart(javax.servlet.http.HttpServletRequest request)
Return a ShoppingCart instance if there is one stored in http session. |
java.lang.String |
getStringParameterOrAttribute(javax.servlet.http.HttpServletRequest request,
java.lang.String name,
java.lang.String defaultVal)
Get a string parameter or attribute, with a fallback value. |
java.lang.String |
getUrl(javax.servlet.http.HttpServletRequest request)
Retrive the absolute url from the given request. |
void |
setElasticPath(ElasticPath elasticpath)
Inject the ElasticPath singleton. |
void |
setShoppingCart(javax.servlet.http.HttpServletRequest request,
ShoppingCart shoppingCart)
Set a ShoppingCart into http sessino. |
Method Detail |
---|
java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
request
- The Http request to retrieve cookies fromcookieName
- The name of the cookie to be retrieved
ElasticPath getElasticPath()
int getIntParameterOrAttribute(javax.servlet.http.HttpServletRequest request, java.lang.String name, int defaultVal)
request
- current HTTP requestname
- the name of the parameterdefaultVal
- the default value to use as fallback
java.lang.Long getLongParameter(javax.servlet.http.HttpServletRequest request, java.lang.String parameterName) throws EpRequestParameterBindingException
Long
from the given request.
request
- the requestparameterName
- the parameter name
Long
type instance if the parameter is set, otherwise null
EpRequestParameterBindingException
- if the parameter value isn't a number.ShoppingCart getShoppingCart(javax.servlet.http.HttpServletRequest request)
ShoppingCart
instance if there is one stored in http session. Otherwise, create a new one and return it.
request
- the http request
ShoppingCart
instancejava.lang.String getStringParameterOrAttribute(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.String defaultVal)
request
- current HTTP requestname
- the name of the parameterdefaultVal
- the default value to use as fallback
java.lang.String getUrl(javax.servlet.http.HttpServletRequest request)
request
- the request
void setElasticPath(ElasticPath elasticpath)
elasticpath
- the ElasticPath singleton.void setShoppingCart(javax.servlet.http.HttpServletRequest request, ShoppingCart shoppingCart)
ShoppingCart
into http sessino.
request
- the http requestshoppingCart
- the shopping cart to save
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |