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 DeployBehaviorUtil
protected BroadleafSandBoxResolver
protected BroadleafSiteResolver
protected BroadleafThemeResolver
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
Creates a BroadleafRequestContext with supported values populatedvoid
establishThinRequestContext
(boolean forceCreate) protected void
establishThinRequestContextInternal
(boolean includeTheme, boolean includeSandBox) Adds request and site to the BroadleafRequestContextprotected void
establishThinRequestContextInternal
(boolean includeTheme, boolean includeSandBox, boolean forceCreate) void
Creates a BroadleafRequestContext without a Sandboxvoid
Creates a BroadleafRequestContext without a Theme or Sandboxprotected String
getContextName
(jakarta.servlet.http.HttpServletRequest request) protected org.springframework.security.core.context.SecurityContext
readSecurityContextFromSession
(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)
-