Hi there Hans, Thanks for the input. I'd actually checked the 2.2 public draft and there is no mention of this in there. And I just checked the JSP 1.1 draft and it's missing there too! Maybe Sun changed their mind? :-) Or I suppose more probably it just got lost in the rush... :-) I hope I don't have to use a URL connection in this case. It's a very ugly solution to what I would imagine would be a pretty common problem. :-( Geoff -----Original Message----- From: Hans Bergsten <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] <[EMAIL PROTECTED]> Date: Monday, 2 August 1999 3:02 Subject: Re: API question: RequestDispatcher.include() - how flexible is it? >Geoff Soutter wrote: >> >> I have a servlet that caches all it's output in a buffer so that I can >> control what gets sent to the browser and when. Now, I want to include the >> generated output of a third party servlet in one of my servlet responses. >> >> I looked at using RequestDispatcher.include(). It lets me call another >> servlet, but it doesn't let me cache the output of that servlet! Ouch! >> >> It looks as if I could do what I wanted if I implemented my own "dummy" >> ServletResponse which just cached the included servlet's into a buffer and >> the extacted it once the include had finished. However, I thought maybe the >> servlet engine may try and cast the ServletResponse back to it's own type >> when you pass it to include()... >> >> Does anyone know if this is "allowed" by the API, or perhaps there is a more >> obvious way that I am missing. I had a quick look at the spec and it didn't >> seem to mention it... > >The JSP 1.0 Appendix B has a number of clarifications of the Servlet 2.1 >API. It says this about request and response in RD.include/forward: > > "A RequestDispatcher object can be used to perform include() and forward() > operations. These methods should only be invoked while processing a service() > request, and the request and a response objects MUST be the request and > response objects that are being processed through the service() method > invocation." > >This clarification will most likely be included in the Servlet 2.2 spec, >so your approach will not work. > >What you can do is using a URLConnection to get the outout from the third >party servlet and add it to your buffer. > >-- >Hans Bergsten [EMAIL PROTECTED] >Gefion Software http://www.gefionsoftware.com ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
