0
votes

I'm learning about servlets and JSP and I try to make an app. The app is from this page

This is the structure of the app:

enter image description here

And I put all the JSP in WEB-INF:

enter image description here

When I try to run any jsp it's not working, I get this error: HTTP Status 404 – Not Found... Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

If I move the jsp in WebContent the app is working succesfully. But I want to keep the jsp in WEB-INF. What should I do? Thanks in advance!

1
The whole point of putting them in WEB-INF is precisely to make it impossible to execute them. Because you want the request to go through a controller first, which would then forward to a JSP.JB Nizet
did you have any index.html. Which is point out in the web.xml?Shibina EC
How is the JSP page (in the WEB-INF) is being accessed? What is the code?prasad_
Post your servlet code, so that we can help you.Avijit Barua

1 Answers

1
votes

Seems i got your problem. If you have servlet class write code to forward to jsp page like this. Because you have put your jsp page inside WEB-INF/view

request.getRequestDispatcher("/WEB-INF/view/homeView.jsp").forward(request, response);