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 populatedvoidestablishThinRequestContext(boolean forceCreate) protected voidestablishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox) Adds request and site to the BroadleafRequestContextprotected voidestablishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox, boolean forceCreate) voidCreates a BroadleafRequestContext without a SandboxvoidCreates a BroadleafRequestContext without a Theme or Sandboxprotected StringgetContextName(jakarta.servlet.http.HttpServletRequest request) protected org.springframework.security.core.context.SecurityContextreadSecurityContextFromSession(jakarta.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 -
establishThinRequestContext
public void establishThinRequestContext(boolean forceCreate) -
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 BroadleafRequestContextIf includeTheme is true then also adds the Theme. If includeSandBox is true then also adds the SandBox.
- Parameters:
includeTheme-includeSandBox-
-
establishThinRequestContextInternal
protected void establishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox, boolean forceCreate) -
clearThinRequestContext
public void clearThinRequestContext() -
getContextName
-
readSecurityContextFromSession
protected org.springframework.security.core.context.SecurityContext readSecurityContextFromSession(jakarta.servlet.http.HttpSession httpSession)
-