struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Subject Re: about DAO
Date Mon, 03 Mar 2008 11:26:15 GMT
hns wrote:
>     	InputStream is = getClass().getResourceAsStream("/db.properties");
>
>   

Don't include a leading slash unless you really mean the root directory 
(which you shouldn't do in a webapp).

Instead, this line:

InputStream is = getClass().getResourceAsStream("db.properties");

will look for the file in the base of the classpath. (eg 
WEB-INF/classes/db.properties or in a jar)


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message