I have a file under WEB-INF folder named a.txt
In may
Servlet code MyServlet.java i use:
getServletContext().getResource("/WEB-INF/a.txt");
it evaluates to
null.
But as SRV.9.5 notes:
The WEB-INF node is not part of the public document tree of the application. No file contained in the WEB-INF directory may be served directly to a client by the container. However, the contents of the WEBINF directory are visible to servlet code using the getResource and getResourceAsStream method calls on the ServletContext, and may be exposed using the RequestDispatcher calls. Hence, if the Application Developer needs access, from servlet code, to application specific configuration information that he does not wish to be exposed directly to theWeb client, he may place it under this directory.
Why what is the problem???