use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project microservices by pwillhan.
the class WebConfig method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver resolver = new SessionLocaleResolver();
resolver.setDefaultLocale(Locale.ENGLISH);
return resolver;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project tutorials by eugenp.
the class WebMVCConfig method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver localeResolver = new SessionLocaleResolver();
localeResolver.setDefaultLocale(new Locale("en"));
return localeResolver;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project ma-core-public by infiniteautomation.
the class MiscDwr method setLocale.
@DwrPermission(anonymous = true)
public void setLocale(String locale) {
WebContext webContext = WebContextFactory.get();
LocaleResolver localeResolver = new SessionLocaleResolver();
LocaleEditor localeEditor = new LocaleEditor();
localeEditor.setAsText(locale);
localeResolver.setLocale(webContext.getHttpServletRequest(), webContext.getHttpServletResponse(), (Locale) localeEditor.getValue());
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project survey by markoniemi.
the class ApplicationConfig method localeResolver.
@Bean
public LocaleResolver localeResolver() {
SessionLocaleResolver slr = new SessionLocaleResolver();
slr.setDefaultLocale(Locale.ENGLISH);
return slr;
}
use of org.springframework.web.servlet.i18n.SessionLocaleResolver in project cas by apereo.
the class OidcLocaleChangeInterceptorTests method verifyOperation.
@Test
public void verifyOperation() throws Exception {
val response = new MockHttpServletResponse();
val request = new MockHttpServletRequest();
request.setAttribute(DispatcherServlet.LOCALE_RESOLVER_ATTRIBUTE, new SessionLocaleResolver());
oidcLocaleChangeInterceptor.preHandle(request, response, new Object());
assertNull(request.getAttribute(Locale.class.getName()));
val service = "https://localhost/cas/authz?ui_locales=de";
request.addParameter(CasProtocolConstants.PARAMETER_SERVICE, service);
oidcLocaleChangeInterceptor.preHandle(request, response, new Object());
assertNotNull(request.getAttribute(Locale.class.getName()));
}
Aggregations