tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikola Milutinovic" <Nikola.Milutino...@ev.co.yu>
Subject Re: jsp:include / @include.....help !
Date Tue, 06 Nov 2001 07:52:42 GMT
> Hi all
> 
> The features around the include tags and jsp:include directives is not clear
> to me....
> Does anyone know where I can find a document about those directives ?
> 
> For instance, what's good behind <jsp:include> and %@include file=""%, and
> what's bad (the pros and cons)
> Also, I don't really catch the meaning of "relative" when reading
> http://java.sun.com/products/jsp/pdf/card11.pdf
> Is that relative to the web server URL or to the current context ? It does
> not match what I experiment with Tomcat 3.2.3...
> Why is that both do not work the same way at all ? ("relative" does not seem
> to have the same meaning on both cases)
> 
> In short....I'd love to read more about it....so if you know where the
> definitive-killer document lies....

http://java.sun.com -> servlet 2.3 and JSP 1.2 specifications

<%@ include file=""%> is a compile-time directive, used when JSP page needs to be transformed
into a servlet (anytime it is changed and then someone requests it). It is like "#include
<*.h>" directive from C/C++. The file is included as-is, the raw source of it, whatever
it is.

<jsp:include page=""> is a run-time action, which will REQUEST the URL from the engine
and include the output it gets from it. If it is a text file, I guess it will be included
as-is (although filtering can change that). If it is a JSP or a Servlet, it will be executed
and the resulting output will be included.

From the specification, I'd say <jsp:include ...> cannot include resources outside the
server. Am I wrong? Can something like <jsp:include page="http://test.company.com/test/test.php">
be done? Or do I have to write java code to open a socket to the URL and spit it's output
to the out?

Nix.
Mime
View raw message