• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirecting HttpServletRequest to another resource

 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks,
I would like to redirect my incoming servlet request to another resource(full URL availabe) outside of my server.
My request contains Http Headers as well as some parameters.
Can anyone suggest me how to do it?
I want the new resource to get all the header as well as parameter information.
I am using Weblogic 6.1 ( I guess Servlet 2.2).
Thanks,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't redirect and preserve the parameters because redirect creates a new request. What you can do is have your servlet create a connection to the other resource and fake the request, then just pass the results back as your response.
Bill
 
Pradeep Sahoo
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill for your answer.
If you could explain me with a short code snippet it would be great.
Thanks,
Pradeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic