1

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 Answers1

2

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);
Avijit Barua
  • 2,950
  • 5
  • 14
  • 35
  • Thanks for reply! I resolved the problem...can I ask you something? Why did he override the isUserInRole() and getUserPrincipal() methods in UserRoleRequestWrapper class? He never used these methods... –  Jul 05 '18 at 14:40
  • Sorry man ! I cannot describe you because now i don't have such knowledge :( – Avijit Barua Jul 05 '18 at 15:57
  • @gaby, If the answer help you can you mark this one as important please ? So that it will help other ! – Avijit Barua Nov 12 '18 at 06:50