Code example for ServletWebRequest

0
 */ 
public class BroadleafRedirectController { 
     
    public String redirect(HttpServletRequest request, HttpServletResponse response, Model model) { 
        String path = null; 
        if (BLCRequestUtils.isOKtoUseSession(new ServletWebRequest(request))) { 
            path = (String) request.getSession().getAttribute("BLC_REDIRECT_URL"); 
        } 
 
        if (path == null) { 
            path = request.getContextPath(); 
        } 
        return "ajaxredirect:" + path; 
    } 
} 
Experience pair programming with AI  Get Codota for Java