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

what commits the response ?

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hfsj says,

flush( ) commits the response.
so we cant call anything on the response ( methods to do sendRedirect( ) and adding/setting things in the response ), once we say flush( ).

my query is if, after the response is commited, and i say
out.println( ), where out is a PrintWriter, what will happen ?
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the response is commited you cant forward to any other servlet. You have to choose. Either commit the response and handle the content yourself or forward to another servlet/JSP without commiting the response
 
Joe Harry
Ranch Hand
Posts: 10124
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will give you an IllegalStateException as it is given in the specs.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic