You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Harshal Joshi <ha...@recreatesolutions.com> on 2006/05/22 11:40:10 UTC

problem related include directive & action


Hi,

I want to know exact difference between include directive & include action.
As I have read from some sites & some books
that one diff. is Include directive is take place at translation (compile)
time while action takes place as runtime.
So, if you make change in included file, that change will only reflect by
include action <jsp:action page="..."/>
But I did one example which show me changes in both  include directive as
well as include action.
I did testing on tomcat 4.1 & tomcat 5.0.28.  So can any one tell me exact
diff. b/w include directive & action.

As all r saying abt changes don't reflect by include directive then why I
see changes in my example?

Plz clarify if I am wrong at some place... Thanks for your help...

Example...

file checkInclude.jsp
<b>Include Directive content :: </b>  <%@ include file="included.jsp" %>
<br><br>
<b>Include Action content :: </b>  <jsp:include page="included.jsp" />

file included.jsp
<%@ page language="java" import="java.util.Date" %>
<b>Date is ::</b>
<%= new Date()%>

Result is ::
Include Directive content :: Date is :: Mon May 22 13:14:40 GMT+05:30 2006

Include Action content :: Date is :: Mon May 22 13:14:40 GMT+05:30 2006

Update included.jsp
<%@ page language="java" import="java.util.Date" %>
<b>Today's Date is ::</b>
<%= new Date()%>

Result after update ::
Include Directive content :: Today's Date is :: Mon May 22 13:17:04
GMT+05:30 2006

Include Action content :: Today's Date is :: Mon May 22 13:17:05 GMT+05:30
2006

Thanks & Regards,

Harshal Joshi

Software Engineer


Re: problem related include directive & action

Posted by Mark Thomas <ma...@apache.org>.
Harshal Joshi wrote:
> I want to know exact difference between include directive & include
> action.

The JSP spec is your friend.

http://java.sun.com/products/jsp/reference/api/index.html

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org