Class BroadleafPageController

java.lang.Object
org.broadleafcommerce.common.web.controller.BroadleafAbstractController
org.broadleafcommerce.cms.web.controller.BroadleafPageController
All Implemented Interfaces:
TemplateTypeAware, org.springframework.web.servlet.mvc.Controller

public class BroadleafPageController extends BroadleafAbstractController implements org.springframework.web.servlet.mvc.Controller, TemplateTypeAware
This class works in combination with the PageHandlerMapping which finds a page based upon the request URL.
Author:
bpolster
  • Field Details

  • Constructor Details

    • BroadleafPageController

      public BroadleafPageController()
  • Method Details

    • handleRequest

      public org.springframework.web.servlet.ModelAndView handleRequest(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws Exception
      Specified by:
      handleRequest in interface org.springframework.web.servlet.mvc.Controller
      Throws:
      Exception
    • getExpectedTemplateName

      public String getExpectedTemplateName(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: TemplateTypeAware
      If a custom handler is written and it knows the eventual template name, then it should return the template name when this method is called. This method will always be called after #getBroadleafHandlerInternal(HttpServletRequest) and only if the Handler was able to handle the request (e.g. it returns a non-null value from #getBroadleafHandlerInternal(HttpServletRequest).

      Listed as expected because the HandlerMapping is making a call before the controller logic has been processed. The controller may send the user somewhere else (e.g. an error page, etc.) in which case, the expected template won't be the actual destination.

      Specified by:
      getExpectedTemplateName in interface TemplateTypeAware
      Returns:
    • getTemplateType

      public TemplateType getTemplateType(jakarta.servlet.http.HttpServletRequest request)
      Description copied from interface: TemplateTypeAware
      If a custom handler is written and it knows the eventual template name, then it should return the TemplateType when this method is called. This method will always be called after #getBroadleafHandlerInternal(HttpServletRequest) and only if the Handler was able to handle the request (e.g. it returns a non-null value from #getBroadleafHandlerInternal(HttpServletRequest).
      Specified by:
      getTemplateType in interface TemplateTypeAware
      Returns: