Antonio Petrelli ha scritto:
Rapthor ha scritto:
Hello,

I intent to check whether a jsp file exists or not in my WebApplication.
Doing it this way doesn't work:

            if (new File("WEB-INF/jsp/test.jsp").exists())
                         return true;
Is there a way to get the WebApplication's path that I can specify and point
to?

String path = ServletContext.getRealPath("/WEB-INF/jsp/test.jsp");
File file = new File(path);
if (file.exists)....

Uh ok wrong syntax :-)


String path = request.getSession().getServletContext().getRealPath("/WEB-INF/jsp/test.jsp");
File file = new File(path);
if (file.exists())....

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to