Class ProductHandlerMapping
java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.broadleafcommerce.common.web.BLCAbstractHandlerMapping
org.broadleafcommerce.core.web.catalog.ProductHandlerMapping
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.ApplicationContextAware,org.springframework.core.Ordered,org.springframework.web.context.ServletContextAware,org.springframework.web.servlet.HandlerMapping
public class ProductHandlerMapping
extends org.broadleafcommerce.common.web.BLCAbstractHandlerMapping
This handler mapping works with the Product entity to determine if a product has been configured for
the passed in URL.
If the URL matches a valid Product then this mapping returns the handler configured via the controllerName property or blProductController by default.
- Since:
- 2.0
- Author:
- bpolster
- See Also:
-
ProductCatalogService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.broadleafcommerce.core.catalog.service.CatalogServicestatic final Stringprotected StringFields inherited from class org.broadleafcommerce.common.web.BLCAbstractHandlerMapping
envFields inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
mappingsLoggerFields inherited from class org.springframework.context.support.ApplicationObjectSupport
loggerFields inherited from interface org.springframework.web.servlet.HandlerMapping
BEST_MATCHING_HANDLER_ATTRIBUTE, BEST_MATCHING_PATTERN_ATTRIBUTE, INTROSPECT_TYPE_LEVEL_MAPPING, LOOKUP_PATH, MATRIX_VARIABLES_ATTRIBUTE, PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE, PRODUCIBLE_MEDIA_TYPES_ATTRIBUTE, URI_TEMPLATE_VARIABLES_ATTRIBUTEFields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.broadleafcommerce.core.catalog.domain.ProductfindProductUsingIdParam(jakarta.servlet.http.HttpServletRequest request) protected org.broadleafcommerce.core.catalog.domain.ProductfindProductUsingUrl(jakarta.servlet.http.HttpServletRequest request) protected ObjectgetHandlerInternal(jakarta.servlet.http.HttpServletRequest request) voidsetDefaultTemplateName(String defaultTemplateName) booleanshouldSkipExecution(jakarta.servlet.http.HttpServletRequest request) Methods inherited from class org.broadleafcommerce.common.web.BLCAbstractHandlerMapping
allowCategoryResolutionUsingIdParam, allowProductResolutionUsingIdParam, getControllerName, getDefaultHandler, setControllerNameMethods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping
adaptInterceptor, detectMappedInterceptors, extendInterceptors, formatMappingName, getAdaptedInterceptors, getCorsConfiguration, getCorsConfigurationSource, getCorsHandlerExecutionChain, getCorsProcessor, getHandler, getHandlerExecutionChain, getMappedInterceptors, getOrder, getPathMatcher, getPatternParser, getUrlPathHelper, hasCorsConfigurationSource, initApplicationContext, initInterceptors, initLookupPath, setAlwaysUseFullPath, setBeanName, setCorsConfigurations, setCorsConfigurationSource, setCorsProcessor, setDefaultHandler, setInterceptors, setOrder, setPathMatcher, setPatternParser, setRemoveSemicolonContent, setUrlDecode, setUrlPathHelper, usesPathPatternsMethods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextMethods inherited from class org.springframework.context.support.ApplicationObjectSupport
getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext
-
Field Details
-
CURRENT_PRODUCT_ATTRIBUTE_NAME
- See Also:
-
charEncoding
-
defaultTemplateName
-
catalogService
protected org.broadleafcommerce.core.catalog.service.CatalogService catalogService
-
-
Constructor Details
-
ProductHandlerMapping
public ProductHandlerMapping()
-
-
Method Details
-
getHandlerInternal
protected Object getHandlerInternal(jakarta.servlet.http.HttpServletRequest request) throws Exception - Specified by:
getHandlerInternalin classorg.springframework.web.servlet.handler.AbstractHandlerMapping- Throws:
Exception
-
shouldSkipExecution
public boolean shouldSkipExecution(jakarta.servlet.http.HttpServletRequest request) throws org.springframework.web.bind.ServletRequestBindingException - Throws:
org.springframework.web.bind.ServletRequestBindingException
-
findProductUsingIdParam
protected org.broadleafcommerce.core.catalog.domain.Product findProductUsingIdParam(jakarta.servlet.http.HttpServletRequest request) throws org.springframework.web.bind.ServletRequestBindingException - Throws:
org.springframework.web.bind.ServletRequestBindingException
-
findProductUsingUrl
protected org.broadleafcommerce.core.catalog.domain.Product findProductUsingUrl(jakarta.servlet.http.HttpServletRequest request) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
getDefaultTemplateName
-
setDefaultTemplateName
-