Showing results for 
Search instead for 
Did you mean: 

Cannot read Property file from JSP in a Web Module Project

Former Member
0 Kudos

I have tried to read the properties file in two ways but am not able to read it because i cannot find the correct path of the properties file.

1st Method :

Properties props = new Properties();

InputStream is =



if (is != null) {



Enumeration keysEnum = Props.propertyNames();

while (keysEnum.hasMoreElements()) {

out.println(keysEnum.nextElement()) ;


2nd Method :

Here "" is the package name and "test" is the Properties file name

ResourceBundlebundle = ResourceBundle.getBundle("");

for (Enumeration e = bundle.getKeys(); e.hasMoreElements();)


String key = (String) e.nextElement();

out.print((String) e.nextElement());

String s = bundle.getString(key);

request.getComponentSession().putValue(key, s);


I cannot read the properties file even when I keep in it the WEB-INF folder.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos


put the properties file below /WEB-INF/classes (when using a Web Module Project) or /PORTAL-INF/classes (when using a Portal Component Project). You then can accesss the file with


<current_class_name> is the name of the class, that you want to access the properties file from. Don't forget the leading "/"! If you want to put the properties file inside a package, for example "" you might use the following snippet:


Regards, Lars