Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package pl.matisoft.soy.locale;
 
 
Created with IntelliJ IDEA. User: mati Date: 01/11/2013 Time: 21:47
public class SpringLocaleProvider implements LocaleProvider {
    @Override
    public Optional<LocaleresolveLocale(final HttpServletRequest request) {
        final LocaleResolver localeResolver = (LocaleResolverrequest.getAttribute(.);
        if (localeResolver != null) {
            final Locale locale = localeResolver.resolveLocale(request);
            if (locale != null) {
                return Optional.of(locale);
            }
        }
        return Optional.fromNullable(request.getLocale());
    }
New to GrepCode? Check out our FAQ X