voyent
Easy way to access ApplicationResources.properties from backing bean?  XML
Forum Index -> General Help
Author Message
chrisg888

Joined: 22/Feb/2009 00:00:00
Messages: 4
Offline


I have a validator in a backing bean. I want to be able to internationalize the error message displayed. Is there an easy call I can use to get properties in the java code? Or do I have to write some utility class to read the properties?

Thanks
pvoigt

Joined: 07/Nov/2009 00:00:00
Messages: 18
Offline


You need an utility class. Have a look at the Icefaces components-showcase.

http://sventon.icefaces.org/svn/showfile.svn?name=repo&revision=16069&path=/icefaces/trunk/icefaces/samples/component-showcase2/common-src/org/icefaces/application/showcase/util/MessageBundleLoader.java
chrisg888

Joined: 22/Feb/2009 00:00:00
Messages: 4
Offline


Works like a charm. Thanks.

Note for whomever searching for this solution: leave off the .properties extension when you're entering your MESSAGE_PATH.

public static final String MESSAGE_PATH= "com.whatever.path.ApplicationResources"; // don't put .properties on end.
 
Forum Index -> General Help
Go to:   
Powered by JForum 2.1.7ice © JForum Team