I am building a Dynamic web application in Eclipse.
In my Login.java
servlet, I want the doGet()
method to perform some logic (i.e. check if the user is already logged in) and open the page login.jsp
located in the webapp
folder, as seen in the image.
I've tried variations of
request.getRequestDispatcher("/src/main/webapp/login.jsp").forward(request, response);
but I keep getting 404 errors that The requested resource is not available.
.
How do I determine the proper path that the system wants in order to display this page?
src/main/...
are Maven conventions for building your project. They do not exist at deployment/runtime. – Sotirios Delimanolis 2 days agorequest.getRequestDispatcher("/login.jsp").forward(request, response);
– user3218114 2 days ago