Tuesday, August 10, 2010

How to Read resouce bundle values in Managed bean

Resource Bundle could be read in managed bean as below

String BUNDLE_NAME = "path.filename";
ResourceBundle rsBundle = BundleFactory.getBundle(BUNDLE_NAME);
String viewText  = rsBundle .getString("Text_Code");


I read in couple of Oracle forums that developers foound issue when they deploy this to standalone weblogic server. If its not working for you on standalone WLS server check if configurations are correct for resource bundle at Project Properties --> Resource Bundle.

1 comment:

  1. Awesome. You made my day. Other methods all over the net seem to rely on current ViewRoot which isn't available in mt case since I call this from the managed bean's constructor.

    ReplyDelete