Hi,
I'm learning jsf and i have a problem with a recent test. How can i change the language of my pages and keep it to the next pages ?
To summarize i want that one user can change a page to another language and keep this setting for all the time he stay connected.
I can do it for one page but if i go to the next one i return to the default language![]()
For the moment i have this :
Any ideas ?Code:in jsp page : <h:commandLink action="#{languageSwitcher.switchOnEn}" immediate="true"> <h:graphicImage value="img/en.jpg" width="30px" height="20px" style="border:0px"/> </h:commandLink> ... in class LanguageSwitcher : public String switchOnEn() { FacesContext context = FacesContext.getCurrentInstance(); context.getViewRoot().setLocale(Locale.ENGLISH); return null; } ... in config.xml: <managed-bean> <managed-bean-name>languageSwitcher</managed-bean-name> <managed-bean-class>test.LanguageSwitcher</managed-bean-class> <managed-bean-scope>session</managed-bean-scope>(request?) </managed-bean>![]()




Bookmarks