• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with RequestDispatcher

 
Michael Chua
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Chua
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so...
thanks very much for the fast reply
I think I'll just think of some other way
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic