You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Shun, Vadim" <VS...@newcorp.com> on 2000/08/18 19:21:11 UTC
Double @include error
Hi,
I am using Tomcat 3.1 on Windows 2000 (hmm!).
I attempted to include the same JSP twice and received an error.
Something like
1.jsp:
Some HTML
<%@ include file="OptionMonth.jsp">
Some other HTML
<%@ include file="OptionMonth.jsp">
Some HTML
Here Tomcat kicked the following error error:
"org.apache.jasper.compiler.ParseException: Seen file \jsp\OptionMonth.jsp
already, maybe this is a recursive include?!"
The exception is kicked by PushFile function.
I opened JSP 1.1 spec and could not find anything that would require a
container to prevent duplicate includes. To me it looks like it might be
container implementation fault, which probably uses included file as a key
into the Hashtable.
Or am I wrong and there is some good reason not to include the file twice?
In my case, I just had some long information which appears in several
places.
Do I have an alternative except taglibs to achieve this?
Thanks,
Vadim Shun
NEW Corp
Dulles, VA
Re: Double @include error
Posted by Brian Richards <nc...@pobox.com>.
yes that's correct the reason is that <%@ include file="filename" %> works
like #include in c++ it just pastes the file into the jsp before it is
compiled.
-Brian
----- Original Message -----
From: "Shun, Vadim" <VS...@newcorp.com>
To: <to...@jakarta.apache.org>
Sent: Friday, August 18, 2000 1:21 PM
Subject: Double @include error
> Hi,
>
> I am using Tomcat 3.1 on Windows 2000 (hmm!).
> I attempted to include the same JSP twice and received an error.
> Something like
>
> 1.jsp:
> Some HTML
> <%@ include file="OptionMonth.jsp">
> Some other HTML
> <%@ include file="OptionMonth.jsp">
> Some HTML
>
> Here Tomcat kicked the following error error:
> "org.apache.jasper.compiler.ParseException: Seen file \jsp\OptionMonth.jsp
> already, maybe this is a recursive include?!"
> The exception is kicked by PushFile function.
>
> I opened JSP 1.1 spec and could not find anything that would require a
> container to prevent duplicate includes. To me it looks like it might be
> container implementation fault, which probably uses included file as a key
> into the Hashtable.
>
> Or am I wrong and there is some good reason not to include the file twice?
> In my case, I just had some long information which appears in several
> places.
> Do I have an alternative except taglibs to achieve this?
>
> Thanks,
>
> Vadim Shun
> NEW Corp
> Dulles, VA
>
>
>