Put it in the same place as the referencing class.
WEB-INF/classes/com/foo/web/AServlet.class
WEB-INF/classes/com/foo/web/db.properties
-cheng
glassfish_at_javadesktop.org wrote:
> I am use the Netbeans (5.5.1) to do the exercise.
>
> I set some config information into a properties file, such as "db.properties" as below
>
> dbuser=username
> dbpass=password
>
> and place it to /web/ folder. In a class, I used code:
>
> Properties dbprop = new Properties();
> dbprop.load(this.getClass().getResourceAsStream("db.properties"));
>
> StringBuffer dsb = new StringBuffer();
> dsb.append(dbprop.getProperty("dbuser"));
> dsb.append(dbprop.getProperty("dbpass"));
>
> When use the app, it came up error for the line of
> dbprop.load(this.getClass().getResourceAsStream("db.properties"));
>
> Where should the "db.properties: to be placed?
> [Message sent by forum member 'kingsz1' (kingsz1)]
>
> http://forums.java.net/jive/thread.jspa?messageID=241568
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>