tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Davidson <bi...@seatadvisor.com>
Subject Re: <jsp:include> versus <% include %>
Date Thu, 05 Jun 2008 20:42:26 GMT
Andrei Tchijov wrote:
> they are identical. you will want to use <jsp:include> if you care to 
> have your JSP pages in form of valid XML.
They are most definitely not identical.

<%@include ... %> happens at compile time.  That is, only the first
time the JSP page is loaded.  The included data ends up in the compiled
servlet.  It has been my experience that you can have other JSP directives
in the included file and they will be properly interpreted.

<jsp:include ... /> happens at run time, every time the JSP page is
loaded.  The included data is not compiled into the servlet, rather
the generated servlet has code to re-read the included file every time
it runs.  It has been my experience that JSP tags in the included file
will not be interpreted so you're pretty much limited to HTML (or whatever
your final output format to the user agent is) in the included file.



Mime
View raw message