RE: jsp:include semantics?
I'm not surprised that it is the behavior that you're observing. There is only one request object, and it persists through the whole request. It doesn't matter how many page (i.e.: JSP or servlet) boundaries that you cross, there is only one request object. I suspect that the best way to succeed at what your attempting is to redirect the client to fetch the JSP itself so that a different request object is created. Perhaps one of the other HttpRequest methods contains the information about the new parameters. You should check all of them, including (but not limited to) getPathInfo, getPathTranslated, getRequestURI, getRequestURL, getServletPath. You should also check the content of ServletContext.getRealPath. Another possibility is putting a JavaBean into the request scope to hold your modified parameters, initializing its properties when the JSP is invoked. Your servlet would access this JavaBean using the HttpRequest.getAttribute method. At 09:11 2003-02-06 -0500, you wrote: My original call is to a servlet /myapp/myservlet/param1/param2. That servlet forwards to a jsp /myapp/wrapper.jsp. The jsp then includes the same servlet that called it, but changes the path, e.g., When I set a breakpoint, in the servlet, it seems as if the request object is the same request object as the one from the original servlet. Specifically, the URI doesn't reflect the changes that were made in the jsp. It's spooky... Dave Sean Dockery [EMAIL PROTECTED] Certified Java Web Component Developer Certified Delphi Programmer SBD Consultants http://www.sbdconsultants.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp:include semantics?
> -Original Message- > From: David Keyes [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, February 05, 2003 1:00 PM > To: [EMAIL PROTECTED] > Subject: FW: jsp:include semantics? > > > Hello. > > What are the semantics of 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? > > Thanks... > > Dave Keyes I'm pretty sure that you can include a servlet. I think you'd want the url to just be "/myservlet" without the webapp path prepended. -- Tim Moore / Blackboard Inc. / Software Engineer 1899 L Street, NW / 5th Floor / Washington, DC 20036 Phone 202-463-4860 ext. 258 / Fax 202-463-4863 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: jsp:include semantics?
OK, oops, the path should have been relative to the webapp. But now I'm seeing a different set of problems. My original call is to a servlet /myapp/myservlet/param1/param2. That servlet forwards to a jsp /myapp/wrapper.jsp. The jsp then includes the same servlet that called it, but changes the path, e.g., When I set a breakpoint, in the servlet, it seems as if the request object is the same request object as the one from the original servlet. Specifically, the URI doesn't reflect the changes that were made in the jsp. It's spooky... Dave -Original Message- From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 05, 2003 3:37 PM To: Tomcat Users List Subject: Re: jsp:include semantics? 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 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 has to be context relative. If "/mywebapp" is the context path of your webapp, then you should say: instead of: 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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]