I have a dynamic web project named Report that utilizes the default generation strategy employed by Eclipse. I have added a page hello.jsp underneath the WEB-INF directory and have deployed the the J2EE preview server. When the page launches in my browser I am directed to the following URL:
http://localhost:8080/Report
this page has two hyperlinks:
META-INF
WEB-INF
both with sizes of zero (0) bytes. My question is why am I unable to access /Report/hello.jsp? It results in a not found similarly /Report/WEB-INF/hello.jsp also results in a not found exception.
Files in
/WEB-INFand/META-INFfolders are intented for MVC view files, template files, include files, tag files, configuration files, etc, not for public web resources which are intented to be directly accessed by URL.Put your
hello.jspoutside/WEB-INFfolder and access it by/Report/hello.jspinstead.If you really need to have your JSP in
/WEB-INFfolder (in order to act as a MVC view), then you need to create a front controller servlet which serves it up byRequestDispatcher#forward(). See also our servlets wiki page for a kickoff example.