Thanks to this post, https://stackoverflow.com/a/28047512/1227941 I am now using CDI to make msg available in my @Named beans like this:
@RequestScoped
public class BundleProducer {
@Produces
public PropertyResourceBundle getBundle() {
FacesContext context = FacesContext.getCurrentInstance();
return context.getApplication().evaluateExpressionGet(context, "#{msg}", PropertyResourceBundle.class);
}
}
With Injection like:
@Inject
private PropertyResourceBundle bundle;
The question: What should I do if I have more property files: ui.properties
, admin.properties
...?