This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat 5.5 Migration - Request Dispatcher issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 5.5 Migration - Request Dispatcher issue" Watch "Tomcat 5.5 Migration - Request Dispatcher issue" New topic

Tomcat 5.5 Migration - Request Dispatcher issue

Sivaraman Lakshmanan
Ranch Hand

Joined: Aug 02, 2003
Posts: 231
Hi All,

We are migrating our application from Tomcat 4.1.2 to Tomcat 5.5. Our application mainly consists of servlets and jsp. After migrating to tomcat 5.5
we are facing a strange issue. In our application we are using request dispatcher to forward to various jsp resources as shown below.

this was working perfectly fine when we were using tomcat 4.1.2 now in tomcat 5.5 we are getting 404 error as the container is looking for the jsp
relative to the servlet path.

I cannot changes the code to correct the path as there are more than 250 occurance which will be a huge effort. I tried writing a servlet filter
to catch the request and do something but the request dispatcher forward is not caught by the filter as this is happening in the server.

I would appreciate if someone could please tell me an easy way to solve this issue without making changes to the existing code.

Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902

If you can't change the "code" then change the "path" relative to the servlet path. I mean, move the jsp's relative to the context such as while forwarding, container can find them.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I agree. Here's the link:
subject: Tomcat 5.5 Migration - Request Dispatcher issue