title: How to read properties file in /WEB-INF/conf folder in a JAX-WS service
body: <p>I tried reading the properties file like this, but it keeps failing. </p>
  
  <pre><code>public class ReadPropertiesWS {
      private static final String filename = "WEBINF/conf/sample.properties";
      @Resource
      private WebServiceContext context;
      private static Properties properties = new Properties();
  
      public ReadPropertiesWS() throws IOException {
          ServletContext servletContext = (ServletContext) context
                  .getMessageContext().get(MessageContext.SERVLET_CONTEXT);
          InputStream in = servletContext
                  .getResourceAsStream("/WEB-INF/conf/sample.properties");
          try {
              properties.load(in);
              in.close();
          } catch (FileNotFoundException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
      }
  </code></pre>
  
  <p>I'm using JAX-WS and it's deployed in Tomcat.</p>