Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RequestDispatcher

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use RequestDispatcher to redirect to a new server.What I want to do is to redirect to secure server(https)
running on different port using request diaptcher.
I could do it using response.sendRedirect() but i am curious to know whether we can use RequestDispatcher
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Given the architecture of servlets, I don't think that is possible. After all, the response and request already have a HTTP connection established with the existing server.
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think it's architecturally unfeasible, but the Servlet API 2.2 spec says that tou can only dispatch requests to local URIs.
There's nothing preventing you implementing a little bit of proxy code in your servlet to open a connection to another server and send its output to your output stream, though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic