• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Redirecting HttpServletRequest to another resource

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic