Hello everyone, I'm developing a web application under Tomcat 5 and I'm facing a problem with paths to JSPs and servlets (I fear it's kinda stupid, but I cannot get out of it). Basically the web app is working without problems, I got it deployed under my Tomcat and I surf it pointing the browser at http://localhost:8080/<WebAppContext>/index.jsp and so on. When it comes to deploying the webapp in production mode, I can surf it at the address http://www.myweburl.com/index.jsp and so on. I would like to point out that the production server is hosted by a web farm, so I do not have total control over any aspect of the deployment environment. Please notice also that while running locally I have to specify the webapp context, while when running in production mode I have not. I've read the JSP faq about URLs here on JavaRanch, and I'd say it seems quite clear, but instead I feel like I'm missing something. In JSP and servlet code I'm managing URLs and forwards like this :
in JSP :
in Servlets :
suppose JSPName.jsp is located in the root directory.
The problem is that while in production mode when I run the servlet it seems to work right, when I run the same servlet locally I get a 404 because the servlet tries to forward me at the page :
i.e. appending twice the context path. I fear I can't adjust the code to let it run locally, since it will not work in production mode. Again, I feel I'm missing something, how should I code links and forwards to let it run both locally and remotelly, i.e. with and without an explicit context path ? What am I missing ?
Thanks all for kind reply and sorry for such a huge post for such a stupid problem. [ July 02, 2008: Message edited by: Bear Bibeault ]