• Post Reply Bookmark Topic Watch Topic
  • New Topic

Regarding requestdispatcher ??  RSS feed

 
Saurabh Agrawal
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends ,
Could neonoe tell me :
When using a dispatcher and calling .forward(), will doGet() or doPost() be called in the target servlet?
Thanks,
Saurabh
 
Brahim Bakayoko
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has been answered many times here.
The forward will be the same as the initial request. In other words, if the initial request is a POST, the forward will be a POST forward.
Now, to circumvent this, you will have to create a new connection from the servlet using an HttpClient or URLConnection object.
I had once mentioned about using a request wrapper, but I discovered that it won't work.
 
Saurabh Agrawal
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brahim Bakayoko:
This has been answered many times here.
The forward will be the same as the initial request. In other words, if the initial request is a POST, the forward will be a POST forward.
Now, to circumvent this, you will have to create a new connection from the servlet using an HttpClient or URLConnection object.
I had once mentioned about using a request wrapper, but I discovered that it won't work.

Thanks for the information and i am sorry if the topic has already been answered many times here as i have never encountered it .
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!