File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding JSP Action flush attribute

 
Karne Reddy
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Any could clearly explan what the flush attribute in the following action does?

<jsp:include page="jspaction2.jsp" flush="true"/>


------------
SCJP
 
Narendra Dhande
Ranch Hand
Posts: 951
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If flush attribute set to true. The JspWriter ( out) is flushed before the include action. That is the buffered contains (if any) are written to the client.

Suppose the following JSP codes



It the flush is set to false which is default. Then the contents prior to the action may be sent to brower depends on the buffer size.

Thanks
 
Karne Reddy
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Narendra,

But the things are not happening as u said in Tomcat5.0?

The template text or some info before the jsp:include with flush=true is also being sent to the client.


--------
SCJP1.4
 
Narendra Dhande
Ranch Hand
Posts: 951
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How you notice when the contents are send to the browser. In any case they are displaying into the browser as include will not clear the content of the calling page. In case the flash='true', the contents will send immidiately before the include call. In case of flush='flase' , the contents will be send after the buffer is full or response is closed or manually flushed.

You will notice the difference when you have some long processing in the included page and then writing the response.

Thanks
[ July 11, 2006: Message edited by: Narendra Dhande ]
 
Karne Reddy
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx Narendra.
My doubt got rectified.

I thought flushing means i will discard the output generated by
the parent page.


---------
SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic