I am retrieving the user's locale from the database. Whenever user is login then page should display on that perticular language. So for this i am using below code in the JSF
<f:metadata>
<f:event type="preRenderView" listener="#{language.preferredLocale}"/>
</f:metadata>
<ui:define name="content_pane">
<f:view locale="#{language.localeCode}"/>
</ui:define>
//language bean code is
public void preferredLocale(ComponentSystemEvent e){
// code to retrieve locale for particular user
}
But the above code is not working to set the locale on the page onload. is there anyother way i can set the locale on the page load?