Re: [Stripes-users] Reading a properties file

2009-04-02 Thread Richard Hauswald
I often had to deal with loading property files with applications running on different os types written using different frameworks (Spring/Stripes/Eclipse RCP/SWT/Guice). The problem I often had to deal with is to locate the property file. Some frameworks modify the class loader so in such cases it

Re: [Stripes-users] Reading a properties file

2009-04-02 Thread Oscar Westra van Holthe - Kind
On 01-04-2009 at 01:09, AK wrote: > On IRC I got the following suggestion for reading a properties file: > > URL aURL = getClass().getClassLoader().getResource("myApp.properties") > > The other suggestion I found online was: > > InputStream inStream = this.getClass().getClassLoader().getResource

Re: [Stripes-users] Reading a properties file

2009-04-01 Thread Samuel Santos
ResourceBundle rb = ResourceBundle.getBundle("myApp.properties", new Locale("en", "EN")); Of course, you should use the same locale as your request. -- Samuel Santos http://www.samaxes.com/ On Wed, Apr 1, 2009 at 2:24 AM, Philip Constantinou < pconstanti...@evernote.com> wrote: > Apache Common

Re: [Stripes-users] Reading a properties file

2009-03-31 Thread Philip Constantinou
Apache Commons configurations: http://commons.apache.org/configuration/howto_properties.html Is a really nice set of libraries that is a bit better than just using java.util.Properties. It's abstraction also makes it easier to change your mind about where you're putting your properties. If I

[Stripes-users] Reading a properties file

2009-03-31 Thread AK
On IRC I got the following suggestion for reading a properties file: URL aURL = getClass().getClassLoader().getResource("myApp.properties") The other suggestion I found online was: InputStream inStream = this.getClass().getClassLoader().getResourceAsStream ("myApp.properties"); Is there a prefe