You can certainly do this from within a servlet or other java class as far 
as reading config file and whatnot, but you cannot publicly serve static 
content from there.  You could, if you wanted, load up the document into 
memory and serve it as a stream via the servlet, but there is no direct way 
to access anything inside the WEB-INF directory from a web browser (thank 
goodness!!!!).

An example would be:

String contextPath = getServletContext().getRealPath("/");
String myConfigFilePath = contextPath + WEB-INF/myconfigfile.xml
File myFile = new File(myConfigFilePath);

or for a more portable way to read files in servlets:

InputStream is = 
getServletContext().getResourceAsStream("/WEB-INF/myconfigfile.xml");


Jake

At 12:03 PM 7/12/2002 +0300, you wrote:
>hello to everyone
>
>can I access a directory under WEB-INF in tomcat. For instance can I 
>access c:\root\WEB-INF\project
>(I can access lib and classes directory of WEB-INf indirectly when I call 
>a servlet, etc. but what about other folders under WEB-INF?)
>
>thanks in advance,
>
>serdar.

Reply via email to