• 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

What is the impact of changing the @include to <jsp:include> in our j2ee application

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
For improve the J2ee performance of our application I found a point mentioned below.
Use the include directive <%@ include file="copyleft.html" %> where possible, as this is a compile-time directive (include action <jsp:include page="copyleft.jsp" /> is a runtime directive).

Our application is both using <%@ include file> and <jsp: include>.Even if I am not figure out the purpose why they used like.So I am thinking to replace <jsp:include> where they <%@ include file> used.
For example: <%@ include file="../fragments/invoicePopUpJs.jsp" %>
Changed to
<jsp:include file="../fragments/invoicePopUpJs.jsp"></jsp:include>

Please suggest me if I am wrong. Kindly let me know if we will change should it impact our application.

Thanks in advance.

Regards,
Sumanta Panda
 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at this, it might be helpful:

http://faq.javaranch.com/view?IncludesActionDirective

 
Ranch Hand
Posts: 689
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Yes you read it right.

If your page not contains any dynamic content then it is better to use <%@ include file="copyleft.html" %> include directive.

But if your include page contains dynamic data then better to use Standard action <jsp:include ..../>

basically <jsp:include ..../> use to include the page response at run time so it takes time to compile ....

When inclide directive just copy the file contains and Past it on given location ......... So it is fast.... compare to <jsp:include ..../> standard action.




 
Albareto McKenzie
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you use <jsp:include take care that the included jsp is other page, so if you have variables in your includer page are not passed to the included unless you explicitily pass them or they are not in the page scope. (I advise you because I had problems with this and I got crazy for a while)
 
sumanta panda
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to all for your time.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic