aspose file tools*
The moose likes Servlets and the fly likes Problems with RequestDispatcher Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problems with RequestDispatcher" Watch "Problems with RequestDispatcher" New topic
Author

Problems with RequestDispatcher

Michael Chua
Greenhorn

Joined: Apr 21, 2004
Posts: 11
I am recently using the RequestDispatcher to relocate the request to another servlet
When I call the RequestDispatcher's forward method in the doPost method of servlet a to servlet b, It always ends up in servlet b's doPost method
What I want to do is forward the request to servlet b's doGet method
So what should I do achieve this requirement?
thanks...


Just take my heart when you go<br />I don't have a need for it anymore<br /> <br />5/9 SCJP 1.4 passed<br />8/15 SCBCD 1.3 passed<br />SCWCD (in progress)
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you can't.
When you forward a request the request method is forwarded as well. After all the entire request is sent to the other resource like it came directly from the client (with the stuff added you did in the forwarding servlet of course).

A POST request will always be a POST request, learn to live with it.


42
Michael Chua
Greenhorn

Joined: Apr 21, 2004
Posts: 11
so...
thanks very much for the fast reply
I think I'll just think of some other way
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with RequestDispatcher