Changing Locale Dynamically
I am confused about how you are supposed to go about changing the Locale. I am doing this:
<f:loadBundle basename="messages" var="msgs"/>
The swapLocale method swaps the Locale to/from English and Spanish, and my Person bean is session-scoped. The problem is that when I press the button, I don't get the new Locale until I manually reload the page. I put a trace in the swapLocale and getLocale methods, and I find that when I press the button, the getLocale method is called, then the swapLocale method is called, and the getLocale method is not called again after the call to swapLocale. I get the same behavior with action instead of actionListener, and also if I remove immediate="true".
Clearly, I am misunderstanding the lifecycle here. Why isn't getLocale being called after the actionListener method [swapLocale]? What is the proper way to let the user set the Locale?
JSF 2.0 Training Course: http://courses.coreservlets.com/public-courses/jsf2/