• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

flush

 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 664
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic