am writing a servlet which is meant to pass a file into another system. its a static file so i have put it inside my 'WEB-INF' directory but for some reason the code can not instantiate the file.
the code doesnt get inside the if statement since it fails at the if statement check to see if file exists. is there something wrong with my code ??
sony agrwal wrote:Is it possible to access a file using such a path??
I mean a path where in "WEB-INf " is present ??
File f = new File("/WEB-INF/test.afp");
If that is the case then can't someone illegally access the class files if they know the server location and project name
Your servlet can access content under /WEB-INF, the web container cannot.