Class BroadleafContextUtil
java.lang.Object
org.broadleafcommerce.common.web.resource.BroadleafContextUtil
Some resource handlers need a valid site, theme, or sandbox to be available when serving request.
This component provides the establishThinRequestContext() method for that purpose.
- Author:
- bpolster
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DeployBehaviorUtilprotected BroadleafSandBoxResolverprotected BroadleafSiteResolverprotected BroadleafThemeResolverprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidCreates a BroadleafRequestContext with supported values populatedprotected voidestablishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox) Adds request and site to the BroadleafRequestContext If includeTheme is true then also adds the Theme.voidCreates a BroadleafRequestContext without a SandboxvoidCreates a BroadleafRequestContext without a Theme or Sandboxprotected StringgetContextName(javax.servlet.http.HttpServletRequest request) protected org.springframework.security.core.context.SecurityContextreadSecurityContextFromSession(javax.servlet.http.HttpSession httpSession)
-
Field Details
-
siteResolver
-
sbResolver
-
themeResolver
-
deployBehaviorUtil
-
versioningEnabled
protected boolean versioningEnabled
-
-
Constructor Details
-
BroadleafContextUtil
public BroadleafContextUtil()
-
-
Method Details
-
establishThinRequestContext
public void establishThinRequestContext()Creates a BroadleafRequestContext with supported values populated -
establishThinRequestContextWithoutSandBox
public void establishThinRequestContextWithoutSandBox()Creates a BroadleafRequestContext without a Sandbox -
establishThinRequestContextWithoutThemeOrSandbox
public void establishThinRequestContextWithoutThemeOrSandbox()Creates a BroadleafRequestContext without a Theme or Sandbox -
establishThinRequestContextInternal
protected void establishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox) Adds request and site to the BroadleafRequestContext If includeTheme is true then also adds the Theme. If includeSandBox is true then also adds the SandBox.- Parameters:
includeTheme-includeSandBox-
-
clearThinRequestContext
public void clearThinRequestContext() -
getContextName
-
readSecurityContextFromSession
protected org.springframework.security.core.context.SecurityContext readSecurityContextFromSession(javax.servlet.http.HttpSession httpSession)
-