I am just trying to figure out some good approches to detect the locale.
The approach I am following is :
1-One language Bean with the below code
<code>
if(!classUtil.isNullObject(FacesContext.getCurrentInstance())){
return FacesContext.getCurrentInstance().getExternalContext().getRequestLocale();
}
return selectedLanguage;//Return default language in case its not possible to detect the language
</code>
2- creating bean definition inside parent-flow
<code><var name="languageBean" class="com.decitysearch.classified.LanguageBean"/></code>
3- using the same in the xhtml
<code>
<f:view locale="#{languageBean.findDefaultLocale}">
<f:loadBundle var="messageResource" basename="MessageResource_en"/>
</code>
My questions here it goes like: 1-can't we make the bean entry inside spring-context rather than flow bean as I tried with spring-context but getting some scope exceptions. 2-Is there any good approaches to detect the locale
your thought process is highly appreciated.