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 Summary
FieldsModifier and TypeFieldDescriptionprotected DeepLinkService<PageDTO>
protected static String
protected TemplateOverrideExtensionManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetExpectedTemplateName
(jakarta.servlet.http.HttpServletRequest request) 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.getTemplateType
(jakarta.servlet.http.HttpServletRequest request) If a custom handler is written and it knows the eventual template name, then it should return the TemplateType when this method is called.org.springframework.web.servlet.ModelAndView
handleRequest
(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Methods inherited from class org.broadleafcommerce.common.web.controller.BroadleafAbstractController
addDeepLink, getContextPath, isAjaxRequest, jsonResponse
-
Field Details
-
MODEL_ATTRIBUTE_NAME
-
deepLinkService
@Autowired(required=false) @Qualifier("blPageDeepLinkService") protected DeepLinkService<PageDTO> deepLinkService -
templateOverrideManager
-
-
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 interfaceorg.springframework.web.servlet.mvc.Controller
- Throws:
Exception
-
getExpectedTemplateName
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 interfaceTemplateTypeAware
- Returns:
-
getTemplateType
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 interfaceTemplateTypeAware
- Returns:
-