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

flush

 
amarkirt saroay
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this attribute signify?What is its default value for jsp:include?
Is it used any where else also?
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I haven't reached the part of jsp:include.
But in general , flush means you are writing the stream and flushing the contents.
Thats means you are comitting to it and that no further changes like setting up the type of content or forward or anything else cannot take place after that.
If you try to do something after it , then you'll get an IllegalStateException.
 
Jim So
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recall a question in the HeadFirstServlets+Jsp's book... i found it Chapter 5, Q1.

The answer states that if you cann os.write() or os.flush(), then the response is sent back to the client. Therefore if you try and attempt a forward, you will get an IllegalState exception.

Is this true? That both os.write() and os.flush() will cause this?
 
Nabila Mohammad
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jim So wrote:I recall a question in the HeadFirstServlets+Jsp's book... i found it Chapter 5, Q1.

The answer states that if you cann os.write() or os.flush(), then the response is sent back to the client. Therefore if you try and attempt a forward, you will get an IllegalState exception.

Is this true? That both os.write() and os.flush() will cause this?



Forwarding the response is what actually causes the IllegalStateException because your attempting to forward it after the you have flushed.
But its flush() which triggers it.
I find that question a little ambiguous!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic