org.broadleafcommerce.common.util
Class BLCRequestUtils

java.lang.Object
  extended by org.broadleafcommerce.common.util.BLCRequestUtils

public class BLCRequestUtils
extends Object

Convenience methods for interacting with the request

Author:
bpolster

Constructor Summary
BLCRequestUtils()
           
 
Method Summary
static String getURLorHeaderParameter(org.springframework.web.context.request.WebRequest request, String varName)
          Get header or url parameter.
static boolean isOKtoUseSession(org.springframework.web.context.request.WebRequest request)
          Broadleaf "Resolver" and "Filter" classes may need to know if they are allowed to utilize the session.
static void setOKtoUseSession(org.springframework.web.context.request.WebRequest request, Boolean value)
          Sets whether or not Broadleaf can utilize the session in request processing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BLCRequestUtils

public BLCRequestUtils()
Method Detail

isOKtoUseSession

public static boolean isOKtoUseSession(org.springframework.web.context.request.WebRequest request)
Broadleaf "Resolver" and "Filter" classes may need to know if they are allowed to utilize the session. BLC uses a pattern where we will store an attribute in the request indicating whether or not the session can be used. For example, when using the REST APIs, we typically do not want to utilize the session.


setOKtoUseSession

public static void setOKtoUseSession(org.springframework.web.context.request.WebRequest request,
                                     Boolean value)
Sets whether or not Broadleaf can utilize the session in request processing. Used by the REST API flow so that RESTful calls do not utilize the session.


getURLorHeaderParameter

public static String getURLorHeaderParameter(org.springframework.web.context.request.WebRequest request,
                                             String varName)
Get header or url parameter. Will obtain the parameter from a header variable or a URL parameter, preferring header values if they are set.



Copyright © 2013. All Rights Reserved.