Hopefully somebody could point out where I am going wrong...


I am using WAR deployment under Tomcat3.2.1 on a WinNT4 box.

I have placed a file (me.txt) in the WEB-INF directory, and have written the
following servlet which tries to read the file.


public class MercuryServlet extends HttpServlet{
  public void init() throws ServletException {

    InputStream inputStream
    = getServletConfig().getServletContext().getResourceAsStream("me.txt");

    if (inputStream == null) {
      System.out.println("NULL");
    } else {
     System.out.println("NOT NULL");
    }
  }
}


However, inputStream is always null!   Am I approaching this the wrong way,
or is this a bug in Tomcat?  (I have searched the bug database and failed to
find anything so I suspect my understanding of the Servlet spec is faulty).

I thought that the ServletContext object was used to access the WEB-INF
directory.. ?


Thanx in advance,

- Chris.


--

NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected.

Reply via email to