|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.elasticpath.sfweb.util.impl.RequestHelperImpl
public class RequestHelperImpl
The default implementation of RequestHelper
.
Constructor Summary | |
---|---|
RequestHelperImpl()
|
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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestHelperImpl()
Method Detail |
---|
public java.lang.String getCookieValue(javax.servlet.http.HttpServletRequest request, java.lang.String cookieName)
getCookieValue
in interface RequestHelper
request
- The Http request to retrieve cookies fromcookieName
- The name of the cookie to be retrieved
public ElasticPath getElasticPath()
getElasticPath
in interface RequestHelper
public int getIntParameterOrAttribute(javax.servlet.http.HttpServletRequest request, java.lang.String name, int defaultVal)
getIntParameterOrAttribute
in interface RequestHelper
request
- current HTTP requestname
- the name of the parameterdefaultVal
- the default value to use as fallback
public java.lang.Long getLongParameter(javax.servlet.http.HttpServletRequest request, java.lang.String parameterName) throws EpSfWebException
Long
from the given request.
getLongParameter
in interface RequestHelper
request
- the requestparameterName
- the parameter name
Long
type instance if the parameter is set, otherwise null
EpSfWebException
- in case of any error happenspublic ShoppingCart getShoppingCart(javax.servlet.http.HttpServletRequest request) throws EpSfWebException
ShoppingCart
instance if there is one stored in http session. Otherwise, create a new one and return it.
getShoppingCart
in interface RequestHelper
request
- the http request
ShoppingCart
instance
EpSfWebException
- document mepublic java.lang.String getStringParameterOrAttribute(javax.servlet.http.HttpServletRequest request, java.lang.String name, java.lang.String defaultVal)
getStringParameterOrAttribute
in interface RequestHelper
request
- current HTTP requestname
- the name of the parameterdefaultVal
- the default value to use as fallback
public java.lang.String getUrl(javax.servlet.http.HttpServletRequest request)
getUrl
in interface RequestHelper
request
- the request
public void setElasticPath(ElasticPath elasticpath)
setElasticPath
in interface RequestHelper
elasticpath
- the ElasticPath singleton.public void setShoppingCart(javax.servlet.http.HttpServletRequest request, ShoppingCart shoppingCart) throws EpSfWebException
ShoppingCart
into http sessino.
setShoppingCart
in interface RequestHelper
request
- the http requestshoppingCart
- the shopping cart to save
EpSfWebException
- when request or shoppingCart is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |