aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Regarding JSP Action flush attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Regarding JSP Action flush attribute" Watch "Regarding JSP Action flush attribute" New topic
Author

Regarding JSP Action flush attribute

Karne Reddy
Ranch Hand

Joined: May 28, 2006
Posts: 35
Hi,
Any could clearly explan what the flush attribute in the following action does?

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


------------
SCJP


asdfa
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
Karne Reddy
Ranch Hand

Joined: May 28, 2006
Posts: 35
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

Joined: Dec 04, 2004
Posts: 950
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

Joined: May 28, 2006
Posts: 35
Thanx Narendra.
My doubt got rectified.

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


---------
SCJP
 
 
subject: Regarding JSP Action flush attribute