Code example for ServletWebRequest

0
     * SandBox.  
     *  
     */ 
    @Override 
    public SandBox resolveSandBox(HttpServletRequest request, Site site) { 
        return resolveSandBox(new ServletWebRequest(request), site); 
    } 
     
    @Override 
    public SandBox resolveSandBox(WebRequest request, Site site) { 
        Long previousSandBoxId = null; 
        if (BLCRequestUtils.isOKtoUseSession(request)) { 
            previousSandBoxId = (Long) request.getAttribute(SANDBOX_ID_VAR, WebRequest.SCOPE_GLOBAL_SESSION); 
        } 
        SandBox currentSandbox = null; 
        if (!sandBoxPreviewEnabled) { 
            if (LOG.isTraceEnabled()) { 
                LOG.trace("Sandbox preview disabled. Setting sandbox to production"); 
            } 
            request.setAttribute(SANDBOX_VAR, currentSandbox, WebRequest.SCOPE_REQUEST); 
Experience pair programming with AI  Get Codota for Java