2011-05-23 158 views

回答

3

只是让JavaScript的发送以某种方式(form.submit()window.location,AJAX等),HTTP请求,使JSF是能够做到

String locale = getItAsRequestParameterOrSomething(); // "en", "en_US", etc 
FacesContext.getCurrentInstance().getViewRoot().setLocale(new Locale(locale)); 

你可以找到它做了开球例如,通过一个下拉其中由JS在这个答案提交:Localization in JSF, how to remember selected locale per session instead of per request/view

相关问题