# Where to place and how to read properties files in a JSP/Servlet web application?

In my web application I need to put labels in properties files, so I wish to add that to a .properties file and access it when required.

Put it in the classpath, so that you can load it by ClassLoader#getResourceAsStream() with a classpath-relative path:

Properties properties = new Properties();

Here myProperty.properties is supposed to be placed in one of the roots which are covered by the default classpath of a webapp, e.g. webapp's /WEB-INF/lib and /WEB-INF/classes,If the propertiesfile is webapp-specific, best is to place it in /WEB-INF/classes.

If you're using a Maven project, drop it in /main/resources folder.

If you have placed the myProperty.properties it in a Java package structure like com.example, then you need to load it as below