aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes include directive vs standard action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "include directive vs standard action" Watch "include directive vs standard action" New topic
Author

include directive vs standard action

Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
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.


$Hi/\bEr
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

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
Kamal Tripathi
Ranch Hand

Joined: Oct 02, 2008
Posts: 86
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. ???


Kamal Tripathi
SCJP 1.4 90%, SCWCD5 94%, Next SCDJWS--> In Naescent stage. Researching abt exam and material itself.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: include directive vs standard action