On Wed, 5 Feb 2003, David Keyes wrote:
> Date: Wed, 5 Feb 2003 12:59:41 -0500 > From: David Keyes <[EMAIL PROTECTED]> > Reply-To: Tomcat Users List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: FW: jsp:include semantics? > > Hello. > > What are the semantics of <jsp:include> in Tomcat 4.0.x? It seems to me > that if I jsp:include another jsp, things work fine. But if I try to > include a servlet (one that was registered in my web.xml, e.g. url == > "/mywebapp/myservlet") the servlet is treated as if it were a > traditional resource (that is, Tomcat tries to find a file named > "/mywebapp/myservlet"), which of course can't be found since it doesn't > exist. > > Is this behaviour correct? Should I be bugging the Jasper people about > this one? Are there any non-standards-breaking ways of getting around > this? > The path you specify as an argument to <jsp:include> has to be context relative. If "/mywebapp" is the context path of your webapp, then you should say: <jsp:include path="/myservlet" .../> instead of: <jsp:include path="/mywebapp/myservlet" .../> In addition, if you're using a web connector (instead of Tomcat standalone), you'll need to tell it to forward "/myservlet" paths to Tomcat -- this would also affect a direct requests to your servlet from a browser. > Thanks... > > Dave Keyes > Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]