myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Br├╝ckner <>
Subject retrieving resource bundles in backing bean
Date Thu, 10 Jul 2008 09:15:10 GMT
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

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


View raw message