Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doubt with res.sendRedirect

 
Sangeetha Selvaraj
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To support clients without redirect capability, HttpServletRsponse.sendRedirect() method writes a short response body that "
contains a hyperlink to the new location"

Is this valid, cos i dont see anything like this in the API, and "clients without redirect capability?" meaning browsers which dont support redirect??

Thanks,
Sangeetha
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

To support clients without redirect capability, HttpServletRsponse.sendRedirect() method writes a short response body that
"contains a hyperlink to the new location"

Is this valid, cos i dont see anything like this in the API, and "clients without redirect capability?" meaning browsers which dont support redirect??

I dont think it is correct.

sendRedirect() does let the client notice the redirection of Http request. It sends the signal to the browser and ask the browser to send another URL to access the needed resource.

In order to make redirection transparent to the client, you need to use RequestDispatcher.forward(). Please read the APIs for detals.

Nick
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic