Description
I try to filter the locales assignable to session on newSession(request, response) in application. The testcase is simple:
If application supports locale accepted by user client (http-header "accepted-language") then i assign it to session, otherwise
i use the application default.
But the behavior differs to production system. MockHttpRequest.getLocales returns only one locale. But the implementation
used in production system (org.apache.catalina.connector.RequestFacade) provides all locales contained in header.
So my testcase is working in production but not in test.
As an extension to this it COULD be a simplification if application could support query to application supported languages.
Normally this is a decision which is made at design time. So if you develop the application you know the supported languages.
So it would be great if there would be a place where i can query these easily (extension to settings?).
We had two discussions on that in mailing-list:
http://www.nabble.com/Howto-accept-other-then-first-locale-in-HTTP-header-%22Accept-Language%22--to25922534.html
http://www.nabble.com/Wickettester-change-locale-of-request-to25907133.html
Specification is here
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4