tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Kaufman <WKauf...@viquity.com>
Subject RE: how to access a properties file as a resource.
Date Mon, 02 Apr 2001 13:53:38 GMT
Use java.util.ResourceBundle.getBundle().


                                                            -- Bill K.


> -----Original Message-----
> From: Alex Colic [mailto:alex.colic@pop-ware.com]
> Sent: Monday, April 02, 2001 6:51 AM
> To: Tomcat-User
> Subject: how to access a properties file as a resource.
> 
> 
> Hi,
> 
> I have a properties file in the web-inf directory of my web 
> app. How can I
> access that file. It holds my localization settings I have tried.
> 
> String pathSeperator =File.separator.
> 
> InputStream is=context.getResourceAsStream("Web-inf" + pathSeperator +
> "pwWorkRequestProLocalization");
> 
> PropertyResourceBundle  res= new PropertyResourceBundle(is);
> 
> When the input stream tryes to get the resource I get the 
> following Tomcat
> error:
> 
> Ctx(  ): Unsafe path C:\JBuilder4\Projects\pwWorkRequest
> /Web-inf\pwWorkRequestProLocalization"
> 
> And when the PropertyResourceBundle tries to read the input 
> stream I get a
> nullpointerexception.
> 
> I have tried various strings to pass to 
> context.getResourceAsStream() but I
> have not been successful. Any help is appreciated.
> 
> 

Mime
View raw message