Interface BroadleafWebRequestProcessor

All Known Implementing Classes:
AbstractBroadleafWebRequestProcessor, BroadleafAdminRequestProcessor, BroadleafRequestProcessor, BroadleafThemeProcessor, CartStateRequestProcessor, CookieRuleRequestProcessor, CustomerStateRequestProcessor, GeolocationRequestProcessor, TranslationRequestProcessor

public interface BroadleafWebRequestProcessor
Generic interface that should be used for processing requests from Servlet Filters, Spring interceptors or Portlet filters. Note that the actual type of the request passed in should be something that extends NativeWebRequest.

Example usage by a Servlet Filter:

   public class SomeServletFilter extends GenericFilterBean {
      @Resource(name="blCustomerStateRequestProcessor")
      protected BroadleafWebRequestProcessor processor;

      public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) {
          processor.process(new ServletWebRequest(request, response));
      }
   }
 

Also note that you should always instantiate the WebRequest with as much information available. In the above example, this means using both the HttpServletRequest and HttpServletResponse when instantiating the ServletWebRequest

Author:
Phillip Verheyden
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    postProcess(org.springframework.web.context.request.WebRequest request)
    Should be called if work needs to be done after the request has been processed.
    void
    process(org.springframework.web.context.request.WebRequest request)
    Process the current request.
  • Method Details

    • process

      void process(org.springframework.web.context.request.WebRequest request)
      Process the current request. Examples would be setting the currently logged in customer on the request or handling anonymous customers in session
      Parameters:
      request -
    • postProcess

      void postProcess(org.springframework.web.context.request.WebRequest request)
      Should be called if work needs to be done after the request has been processed.
      Parameters:
      request -