tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morahg, Yoav" <ymor...@gist.com>
Subject RE: Recursive JSP include
Date Thu, 19 Oct 2000 19:50:57 GMT
Yeah, this seems to be a bug in Tomcat -- it comes up on the list quite a
bit.

Basically Tomcat only lets you include a file once on a page using the
static (@ include) method. If you feel it's okay for your code, you can use
the dynamic include ...

<jsp:include page="page.jsp" flush="true" />

multiple times legally.

This has the overhead of being compiled every time the page is included, so
it might not be the right solution for you -- but it's the only one I've
found.

Good luck!

-Yoav

---------------------------
Yoav Morahg
Software Engineer
Gist Communications
(212) 965-1999 xt 110
ymorahg@gist.com

Interactive Television Guides


-----Original Message-----
From: Beem Rickey L (Rick) CNIN [mailto:beem_r@crane.navy.mil]
Sent: Thursday, October 19, 2000 3:33 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: Recursive JSP include


I've run into the same problem with Tomcat, among many others with include
files.  You might be able to trick it by making the path to the file look
different but point to the same location.

For example:
<%@ include file="/./templates/security/requireLogin.jsp" %>

I don't know if that will work on an absolution path.  I've started relative
paths with "./" to get them to work.

-----Original Message-----
From: Drew Kidder [mailto:Andrew.Kidder@Tivoli.com]
Sent: Thursday, October 19, 2000 2:25 PM
To: tomcat-user@jakarta.apache.org
Subject: Recursive JSP include


Hello all...

I have a page called index.jsp that does the following JSP include:

<%@ include file="/templates/security/requireLogin.jsp" %>

Later on in the page, I have a link to a page called logout.jsp that also 
includes the same file as above.  The following error gets returned from 
the browser when I try to access the logout.jsp page:

Error: 500

Location: /account/logout.jsp

Internal Servlet Error:

org.apache.jasper.compiler.ParseException: Seen file 
/templates/security/requireLogin.jsp already, maybe this is a recursive 
include?!
         at org.apache.jasper.compiler.JspReader.pushFile(JspReader.java, 
Compiled Code)
         at org.apache.jasper.compiler.JspReader.pushFile(JspReader.java, 
Compiled Code)
         at 
org.apache.jasper.compiler.JspParseEventListener.handleDirective(JspParseEve
ntListener.java, 
Compiled Code)
         at 
org.apache.jasper.compiler.DelegatingListener.handleDirective(DelegatingList
ener.java, 
Compiled Code)
         at org.apache.jasper.compiler.Parser$Directive.accept(Parser.java, 
Compiled Code)
         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
         at org.apache.jasper.compiler.Parser.parse(Parser.java, Compiled
Code)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java, 
Compiled Code)
         at org.apache.jasper.runtime.JspServlet.loadJSP(JspServlet.java, 
Compiled Code)
         at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java, 
Compiled Code)
         at 
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServlet.ja
va, 
Compiled Code)
         at 
org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java, 
Compiled Code)
         at org.apache.jasper.runtime.JspServlet.service(JspServlet.java, 
Compiled Code)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java, 
Compiled Code)
         at 
org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java, 
Compiled Code)
         at 
org.apache.tomcat.core.ContextManager.service(ContextManager.java, Compiled 
Code)
         at 
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java, 
Compiled Code)
         at 
org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java, 
Compiled Code)
         at java.lang.Thread.run(Thread.java, Compiled Code)

Originally, logout.jsp was including the same file twice. However, I have 
commented out both includes with the "<!--" and "-->" pairs, and so the 
file should be including nothing. I also shutdown apache and tomcat, wiped 
the working directory, and restarted tomcat/apache to ensure that the jsp's 
are getting recompiled. I still get this error.

Does anyone know what the problem is, and what I can do to fix it???
Thanks!

------
Andrew Kidder
L3 SW/Support Engineer, IBU
Tivoli Systems

512-436-4544
akidder@tivoli.com
http://www.tivoli.com

Mime
View raw message