Using JSP Get User's Default Language
Hi!
I have to get the User's Default language using JSP that the client is accessing website and u want to rederict him automatically to his default language which he is using. Like in google aur other websites.
If it is also possible in Javascript then it is also acceptable for me.
[303 byte] By [
shnaqvi] at [2007-9-30 19:11:08]

this can only be done if the request has the Accept-Language header set. You can read this using either request.getHeader("Accept-Language") or request.getHeaders("Accept-Language") for an enumeration of all the languages that the user will accept. Look at this page for details on the Accept-Language header: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html Note that the user agent (browser) does not have to provide this information (my Netscape browser does not, and I always get English from Google. My IE browser does, so I will get German if my default lang is set for German).