• 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

jsp:include

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a dbt in
1.include directive and
2.<jsp:inlcde> .
i read tht for 1. it is included at translation time n 2. is included at request time(run time)....
But both r compiled n executed at request time..So where does the basic difference for o/p comes in to picture...
Its given tht after the main jsp in which the file is included is translated n then if any changes r made to the included files,
with <jsp:inlcde> the changes r reflected but with include directive the changes r not reflected..I tried but the changes r reflected in both cases...
So whts the diff b/w the two with rgd to o/p apart frm performance issues..
Anyone pls expain..
Thnx.
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Translation and Requuest/Realtime are two different levels.
Translation happens when your jsp gets converted to the java code.
Request time is when the Servlet is servicing the request through its service method.

Basically what happens in first case, it is like getting jsp for the include file where it is called from and then translating the whole thing at once.

Where as in second case, you translate the main jsp and then do the include thing.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Regarding ur second query that, u r able to see the changes made in the included file in the main file in both cases,
one using <jsp:include ..>
and the second using <%@include file=..%>

Herez what spec says..
" A JSP container can include a mechanism for being notified if an included file changes, so the container can recompile the JSP page. However, the JSP 2.0 specification does not have a way of directing the JSP container that included files have changed."

The above is taken for JSP Spec 2.0

So the container you are using is capable of getting notified when the included file is changed, then u can see the changes reflected even if u use include directive.

So its Container dependent, and the spec doesnot says that itz not possible.

Cheers!!
Srivatsa
 
reply
    Bookmark Topic Watch Topic
  • New Topic