• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

include directive vs standard action

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why include directive is said to be not dynamic?

In HFSJ, they are referring to rollit function and they are trying to say dynamic and in the place where they are explaining params, they tell that it doesnt apply to directive as it is not static?

Please clarify.
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,


this is static include ,here you can not pass parameter to the include page but you can do this in <jsp:include page="myjsp.jsp?key=value"/> this is dynamic inclusion
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wanted to post a trivial doubt on same topic jsp:include Vs @ include.

A.jsp



C.jsp



B.jsp



Now As HFSJ mentions that @ include does everything @ translation time i.e. it copies code of B.jsp into A.jsp and then created instance of servlet A. As such it is more often used for pages which are not updated regularly.

<jsp:include> on the other hand includes a runtime call for B.jsp inside A.jsp and with every request accesses output of B.jsp @runtime.

But in this case how would the difference between jsp:include and @include play out for two subsequent requests to A.jsp and C.jsp??

As per my understanding display would be different for each subsequent request to A.jsp or C.jsp.

Display @ FIRST Request Call to A.jsp ====>

The current date and time are

Feb 27, 2009 21:38:40



Display @ SECOND Request Call to A.jsp ====>

The current date and time are

Feb 27, 2009 21:40:40



Display @ FIRST Request Call to C.jsp ====>

The current date and time are

Feb 27, 2009 21:42:40



Display @ SECOND Request Call to C.jsp ====>

The current date and time are

Feb 27, 2009 21:44:40



So is the difference only related to static HTML, images etc. ???
 
Could you hold this kitten for a sec? I need to adjust this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic