?
Solved

View final URL in Servlet RequestDispatcher forward

Posted on 2007-07-23
7
Medium Priority
?
300 Views
Last Modified: 2013-11-24
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,
John
0
Comment
Question by:texastemplar
  • 3
  • 2
6 Comments
 
LVL 92

Accepted Solution

by:
objects earned 2000 total points
ID: 19552274
just log the value of the url variable
0
 

Author Comment

by:texastemplar
ID: 19566180
That wont work. Im trying to determine the exact url that the app is being forwarded to.

Any other ideas?
0
 
LVL 92

Expert Comment

by:objects
ID: 19570496
why won't it work?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:texastemplar
ID: 19571050
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.  
0
 
LVL 92

Expert Comment

by:objects
ID: 19571409
which would be the value of the 'url' variable wouldn't it?
0
 
LVL 1

Expert Comment

by:Computer101
ID: 20143824
Forced accept.

Computer101
EE Admin
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question