In Spring MVC 4 how can I redirect the user to a localized url according to the browser language (the HTTP header "Accept-Language")?
I would that if an user is trying to access the url example.com/some/path it will redirect to de.example.com/some/path if its browser language is "DE" (i.e. the "Accept-Language" header is set to "de").
In the same way, if an user is accessing de.example.com/some/path and its language is EN it should be redirected to example.com/some/path.
What is the easiest way to get that?
What about something like this in your controller:
Note that language codes are written in lowercase.