Hi,

I also had the same problem. Using <s:loadBundle> from the myfaces sandbox
solved this issue.

 

Guy

 

From: Marcel Brückner [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 10, 2008 12:15 PM
To: users@myfaces.apache.org
Subject: retrieving resource bundles in backing bean

 

MyFaces 1.1.5, Tomcat 5.5

I currently use the following way to retrieve resource bundles:

FacesContext cont = FacesContext.getCurrentInstance();
UIViewRoot viewRoot = cont.getViewRoot();
Locale loc = viewRoot.getLocale();
labelsResource = ResourceBundle.getBundle("labels", loc);

This code is part of a CTOR of a request scoped backing bean.

It sometimes happens that the resource bundle returned from "getBundle" is
"null".

Is there a better way to retrieve the bundle? Is the bundle-loading or
view-root depending on a certain
render-phase?

If nobody has an idea I would try to post it as a bug, since it is
reproducable behaviour.

Marcel 

Reply via email to