Wednesday, October 28, 2009

Get / Set Browser localization

Set Browser Locale:
FacesContext ctx = FacesContext.getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
Locale locale = new Locale("en");// set browser as english
uiRoot.setLocale(locale);
-----------------------------------------------------------
Get Browser Locale
FacesContext ctx = FacesContext.getCurrentInstance();
UIViewRoot uiRoot = ctx.getViewRoot();
uiRoot.getLocale();

No comments:

Post a Comment