Class BroadleafContextUtil

java.lang.Object
org.broadleafcommerce.common.web.resource.BroadleafContextUtil

@Service("blBroadleafContextUtil") public class BroadleafContextUtil extends Object

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 Details

  • Constructor Details

    • BroadleafContextUtil

      public BroadleafContextUtil()
  • Method Details

    • establishThinRequestContext

      public void establishThinRequestContext()
      Creates a BroadleafRequestContext with supported values populated
      See Also:
    • establishThinRequestContext

      public void establishThinRequestContext(boolean forceCreate)
    • establishThinRequestContextWithoutSandBox

      public void establishThinRequestContextWithoutSandBox()
      Creates a BroadleafRequestContext without a Sandbox
      See Also:
    • establishThinRequestContextWithoutThemeOrSandbox

      public void establishThinRequestContextWithoutThemeOrSandbox()
      Creates a BroadleafRequestContext without a Theme or Sandbox
      See Also:
    • 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 -
    • establishThinRequestContextInternal

      protected void establishThinRequestContextInternal(boolean includeTheme, boolean includeSandBox, boolean forceCreate)
    • clearThinRequestContext

      public void clearThinRequestContext()
    • getContextName

      protected String getContextName(jakarta.servlet.http.HttpServletRequest request)
    • readSecurityContextFromSession

      protected org.springframework.security.core.context.SecurityContext readSecurityContextFromSession(jakarta.servlet.http.HttpSession httpSession)