• 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
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Regarding JSP Action flush attribute

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic