Search code examples
securityspringlocale

Spring security: custom login form with locale


I need to develop custom login form which allows user to select language (locale). When user select locale from page has to reload and display in new locale. After page is submited (login button is pressed) then the selected locale has to be set to spring app.

I spent a lot of hours to googling some solution. unfortunatelly there is no working solution :-(((

Any ideas?


Solution

  • You could register a LocaleChangeInterceptor which allows the change of the users locale. Checkout the docs at http://static.springsource.org/spring/docs/3.0.x/reference/mvc.html#mvc-localeresolver