Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

request and translation time including

 
Ranch Hand
Posts: 808
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • 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
  • 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: 9671
42
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Nevertheless, thanks!
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic