• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can sendError be called after flush()??

 
Ernest Lee
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens when we call sendError/setStatus after we called flush() on JSPWrite???

will flush() commits the response??
[This message has been edited by Ernest Lee (edited December 04, 2001).]
 
Fozan Zaidi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When u call flush() response is commited so it is now too late to change status code or header fields of response.Well sendError/sendRedirect at this state will through illegalStateException where as setStatus/setHeader calls will simply be ignored
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well Ernest, setStatus() & setContentType() are the two methods that must be used b4 using any respone body....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic