• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IllegalStateException

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFSJ its mention that you can't forward a request if you have already committed the response.If there is an attempt to do so there will IllegalStateException.

Q1) Why i am not getting IllegalStateException?




 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Amolpalekar.
Calling flush(), causes the data i.e present in the buffer flushes to the response object. If we close() the stream, before forwarding, and calling forward(request,response) causes an IllegalStateException.
 
Hasnain Javed Khan
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This thread might help
Flush()

Kind Regards.
Hasnain.
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



Isn't this supposed to be


Thought println is used with getWriter()
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you write the code of the page to where you are forwarding the request. ie. /sign.do?newParam=test"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic