• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

request and translation time including

 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just want to make sure that I am correct.
Please, read:

Translation time include:
<%@ include file="" %>

<directive:include.file = "" />

Request time include:

<jsp:include page="" flush="" /> [flushing depends on "flush" attribute]

<% pageContext.include(...); %> [always flushes the output of the current page before including the other component]

<% getServletContext().getRequestDispatcher(/...).include(...); %> [always flushes the output of the current page before including the other component]

<% request.getRequestDispatcher(...).include(...) %> [always flushes the output of the current page before including the other component]

Any other ways of including? Please verify.
 
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Lucas Smith wrote:I just want to make sure that I am correct.
Please, read:
<directive:include.file = "" />



i didn't understand this one i think it should be


avi sinha
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

<% getServletContext().getRequestDispatcher(/...).include(...); %> [always flushes the output of the current page before including the other component]


Where did you find this?? I cannot find anywhere in the spec or documentation that include method flushes the output before the include...
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
avi: it's XML view and You are right, your version is good!
Ankit: http://www.ucertify.com/article/differentiate-between-pagecontextinclude-and-jspinclude.html
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Lucas, the link you gave is about pageContext.include, I'm talking about RequestDispatcher.include. The documentation of PageContext.include method states that the buffer will be flushed, but nothing as such is given for RequestDispatcher.include...
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what about that:
https://coderanch.com/t/466924/Web-Component-Certification-SCWCD/certification/pageContext-include;jsessionid=82B172AD7F9BC89A79B4CF976282F6F1

EDIT:
Well, I see. RequestDispatcher.include() doesn't use JSP buffer ;)
pageContext.include flushes the buffer and RequestDispatcher.include() doesn't need it
 
Ankit Garg
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The thread clearly indicates that the RequestDispatcher.include method doesn't flush the output of the current page before doing the include. That's why the behavior was observed. RequestDispatcher.include directly writes to the output stream without flushing the buffer, it doesn't even use the buffer at all...

Edit: Wrote this before Lucas edited his post, so not of much use now
 
Lucas Smith
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nevertheless, thanks!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic