tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From QM <>
Subject Re: when to use <%@include%> when to use <jsp:include>
Date Wed, 08 Dec 2004 00:02:35 GMT
On Wed, Dec 08, 2004 at 12:28:35AM +0800, Zerol Tib wrote:
: As we know, <%@ include%> can include another jsp page 
: at "translation time" while <jsp:include> can include another 
: jsp at "runtime". But when to use each? Could anyone give me
: a scenario?

Adding to the fine responses you've already received:

The build-time include is useful for sharing a JSP fragment amongst
several full JSPs.  If you use a full-blown layout system such as Tiles,
this is moot; but for a more homegrown setup, <%@ include%> is a nice

Two notes if you go this route:
1/ name your JSP fragments something other than ".jsp" (".jspf" is the
unofficial standard) such that they aren't picked up by a precompiler

2/ watch those file sizes.  Overusing the build-time include can fatten
up the resultant .java file to the point it doesn't compile.  (or was
that the JSP itself gets too big to be translated to Java source?
Either way, it's ugly.)



software  --
tech news --

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message