• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Redirect Qn

 
Chandrakanth
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If we write to the PrintWriter after we do
response.sendRedirect("http://yahoo.com");

is there exception thrown, or the thing we write is ignored.

can somebody pls clarify this.
 
vandu matcha
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi chandrakanth,
sendRedirect commits the response.......hence if we send any data after committing the response....IllegalStateException is thrown.....inorder to avoid such situation while using sendRedirect, we can check for response.isCommitted ..whether it is false or true ..i hope it helps u...
Ranchers pls correct me if i have miss something
thanks
vandu
 
Chandrakanth
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fyi, i am not getting any exception thrown, if i write to the PrintWriter, after i do response.sendRedirect
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this thread.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic