Do Not Rely on Browser Settings for Storing Localization Preferences
In designing your presentation layer, you need to be concerned with where you pull localization information to drive the presentation of the user interface. In other words, how are your JSP pages supposed to know that they should present the information for one user in English and information for another user in Hebrew?
The Internet Explorer Language Preference dialog, as shown in Figure 8-1, allows the user to configure the languages he
would like to see in order of preference. A setting such as this will
affect certain HTTP headers such as the
Accept-Language
header. You might think this is great for you as an application
developer; you no longer have to be concerned about where to pull a
user’s preferred localization information. Simply
grab that information from the request headers and use it to drive
your user interface.
![]() |
There are a number of reasons why relying on a browser’s settings or, for that matter, the user’s ability to configure these settings will get you into trouble:
The browser’s settings are outside the scope of your application. Although most browsers on the market today do offer the ability to configure language preference settings, it is not a requirement and therefore might not be present in the configuration. If this is the case, ...
