https://bz.apache.org/bugzilla/show_bug.cgi?id=69735
--- Comment #11 from Michael Osipov <micha...@apache.org> --- (In reply to Christopher Schultz from comment #8) > (In reply to Remy Maucherat from comment #7) > > (In reply to Michael Osipov from comment #6) > > > (In reply to Remy Maucherat from comment #3) > > > > I would have thought this would be (another) feature in default servlet. > > > > I believe ServletRequest.getLocales() will return a sorted list of > > > > locales > > > > according to the quality from the Accept-Language header. So using the > > > > list > > > > to go through possible lookups would work. > > > > > > Attention: That method will also return the JVM's locale as well. As far > > > as > > > I remember this was mandated by the Server API spec. > > > > The javadoc is (the implementation matches it): > > /** > > * Returns an <code>Enumeration</code> of <code>Locale</code> objects > > indicating, in decreasing order starting with > > * the preferred locale, the locales that are acceptable to the client > > based on the Accept-Language header. If the > > * client request doesn't provide an Accept-Language header, this method > > returns an <code>Enumeration</code> > > * containing one <code>Locale</code>, the default locale for the > > server. > > * > > * @return an <code>Enumeration</code> of preferred <code>Locale</code> > > objects for the client > > */ > > Enumeration<Locale> getLocales(); > > > > So the question is if that case where it returns the local JVM's default > > locale needs to be handled. It confused me a little initially so I messed up > > the first patch version. > > Maybe add a check to see if an Accept-Language header is present. > > I think it's reasonable to use the JVM's default locale when there is none > presented by the client. The alternative is to perform zero > content-negotiation if an Accept-Language header is not present which would > perfectly in-line with the HTTP specification. I don't know. My servers haven de_DE.UTF-8 and consider index.html, index.html.de are present, but not .fr and fr is requests why is then index.html.de delivered? I would expect index.html to be delivered. Just like the Apache module would do. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org