History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SM-99
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Matt Raible
Reporter: Michael Gutbier
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Struts Menu

ResourceBundle is kept even if the request sends a different locale

Created: 18/Sep/08 09:04 AM   Updated: 18/Sep/08 09:04 AM
Component/s: Displayers
Affects Version/s: 2.4.3
Fix Version/s: None

Environment: Struts2, Java 6, custom menu displayer, separate resource bundles for English and German


 Description  « Hide
Different locales depending on user's settings (browser) do not work during runtime of the application.
Preconditions: There are two resource bundles for the menu (Menu_en.properties, Menu_de.properties).
Symptoms: Say, the user has English set in the browser.
When the application is first started, a resource bundle is correctly loaded for the first locale that comes from the browser.
However, if a different locale is sent, the first resource bundle is used instead of the right one.

Some research shows that the class net.sf.navigator.taglib.UseMenuDisplayerTag reuses the resource bundles no matter if the locale changed.
The problem seems to be in line 203:

if (rb != null) {
mrDisplayerInstance.setMessageResources(rb);
} else {

Two solutions come to my mind:
a) put each resource bundle in a map; key is the locale; problem: locales without resources must be mapped to a default locale
b) save the last active locale and check if the locale changed since the last request


 All   Comments   Change History   FishEye      Sort Order:
There are no comments yet on this issue.