Code example for ServletWebRequest

0
    @Resource(name = "blLocaleService") 
    private LocaleService localeService; 
 
    @Override 
    public Locale resolveLocale(HttpServletRequest request) { 
        return resolveLocale(new ServletWebRequest(request)); 
    } 
 
    @Override 
    public Locale resolveLocale(WebRequest request) { 
        Locale locale = null; 
 
        // First check for request attribute 
        locale = (Locale) request.getAttribute(LOCALE_VAR, WebRequest.SCOPE_REQUEST); 
 
        // Second, check for a request parameter 
        if (locale == null && BLCRequestUtils.getURLorHeaderParameter(request, LOCALE_CODE_PARAM) != null) { 
            String localeCode = BLCRequestUtils.getURLorHeaderParameter(request, LOCALE_CODE_PARAM); 
            locale = localeService.findLocaleByCode(localeCode); 
            if (BLCRequestUtils.isOKtoUseSession(request)) { 
Contextual code suggestions in your IDE  Get Codota for Java