I'm using MVC and want to put my JSP pages in WEB-INF to avoid direct access to it. I have an index.jsp page and other pages in jsp folder in Web Content and it works. It looks like this:
-Web Content
-index.jsp
-jsp
--main_read.jsp
--...
By the way, index.jsp is my login page and whether user is logged, in controller I use
RequestDispatcher dispatcher =
getServletContext().getRequestDispatcher("jsp/main_read.jsp");
dispatcher.forward(request, response);
I works perfect, but when I'm trying to put my JSP in WEB-INF it fails:
-Web Content
-index.jsp
-WEB-INF
--jsp
---jsp
----main_read.jsp
----...
And gives an error like this
HTTP Status 404 - /Libruary/jsp/main_read.jsp
type Status report
message /Libruary/jsp/main_read.jsp
description The requested resource (/Libruary/jsp/main_read.jsp) is not available.
Apache Tomcat/6.0.26
Probably the problem is in the page path, I write in dispatcher.forward
, but anyway, help me please.