JSF 2.0 set locale throughout session from browser and programmatically [duplicate]
问题 This question already has answers here : Localization in JSF, how to remember selected locale per session instead of per request/view (5 answers) Closed 4 years ago . How do I detect the locale for an application based on the initial browser request and use it throughout the browsing session untill the user specifically changes the locale and how do you force this new locale through the remaining session? 回答1: Create a session scoped managed bean like follows: @ManagedBean @SessionScoped