Hello everyone,
I have been working on a web application for some time and it's coming along, but I have encountered an issue and I don't know how it should be resolved. I'll try to keep it simple while hopefully providing enough information.
What I have done is created a
Servlet with the following mapping "/Users/ViewAccount".
The Servlet is working properly, but the problem is that when I forward the request to my
jsp, the Servlet is looking in "/Users" for the jsp, css and js files. How can I make it so the Servlet searches in the root web folder? All of the other Servlets so far do not specify a subfolder, their mappings are "/Register", "/SignIn", "/Tickets", etc.. so I haven't had the problem until now.
For the request dispatcher, this is the line I have been using:
RequestDispatcher rd = request.getRequestDispatcher("jsp/view_account.jsp"); -- 404 Error
RequestDispatcher rd = request.getRequestDispatcher("/jsp/view_account.jsp"); -- Loads the jsp page, but still looks for the css and js files in the "/Users" directory so I lose my formatting.
I have been using annotations for mapping my Servlets to URL's so my web.xml is mostly empty.
Is there an easy way to fix this?
Thank you for any help or comments.