View final URL in Servlet RequestDispatcher forward

Im using Java servlets and Im using the following code to perform a forward:

 RequestDispatcher rd = request.getRequestDispatcher(url);
            rd.forward(request, response);

My question is: How do I view the final url that the app is forwarding to? I want to see the url after any contexts or anything else has been pre-pended to it. I want to see where the app is actually being forwarded to.

For instance, if I pass in home.html as my url variable, how do I determine what the url variable will look like when RequestDispatcher gets finished with it?

Any help is greatly appreciated!!!

Ive been stuck on this for a while now....:(

Thank you,
Who is Participating?
objectsConnect With a Mentor Commented:
just log the value of the url variable
texastemplarAuthor Commented:
That wont work. Im trying to determine the exact url that the app is being forwarded to.

Any other ideas?
why won't it work?
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

texastemplarAuthor Commented:
I figured it out. The app Im working with had a default error page setup in web.xml so I commented it out and ran the app. This allowed me to see Apache's error page instead of the applications error page. The default error page that Apache uses showed me the url that the RequestDispatcher.forward was creating.  
which would be the value of the 'url' variable wouldn't it?
Forced accept.

EE Admin
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.