Class CookieRuleRequestProcessor
java.lang.Object
org.broadleafcommerce.common.web.AbstractBroadleafWebRequestProcessor
org.broadleafcommerce.core.web.cookie.CookieRuleRequestProcessor
- All Implemented Interfaces:
BroadleafWebRequestProcessor
Populate configured cookie values on the http request thread for use by MVEL request-based rules
Configuration is generally as easy as enabling the feature
via a property and then configuring one or more cookie configurations.
Add
cookie.content.targeting.enabled=true to a property file visible to both admin and site (i.e. common-shared.properties)
Add a cookie configuration to your Spring xml or Java configuration. Sample below demonstrated Java-based config:
@author Jeff Fischer
@Merge("blCookieRuleConfigs") public RuleDTOConfig myCookieRuleDTOConfig() {
RuleDTOConfig config = new RuleDTOConfig("myFieldName", "myLabel");
config.setAlternateName("cookieName");
return config;
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected List<RuleDTOConfig>static final Stringprotected CookieUtilsstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionCookieRuleRequestProcessor(List<RuleDTOConfig> configs, CookieUtils cookieUtils) -
Method Summary
Modifier and TypeMethodDescriptiongetRuleMapFromRequest(org.springframework.web.context.request.WebRequest request) getVals(org.springframework.web.context.request.ServletWebRequest request) voidprocess(org.springframework.web.context.request.WebRequest request) Methods inherited from class org.broadleafcommerce.common.web.AbstractBroadleafWebRequestProcessor
postProcess
-
Field Details
-
FORWARD_HEADER
- See Also:
-
COOKIE_ATTRIBUTE_NAME
- See Also:
-
BLC_RULE_MAP_PARAM
- See Also:
-
cookieUtils
-
configs
-
-
Constructor Details
-
CookieRuleRequestProcessor
-
-
Method Details
-
process
public void process(org.springframework.web.context.request.WebRequest request) -
getRuleMapFromRequest
-
getVals
-