Servlet1 doesn't have to output anything to the standard PrintWriter in your
case. You could conditionally output to a buffer and then handle this buffer
to servlet2. Maybe some custom object inheriting from Response passed as
Request attribute... I assume that you ALSO want servlet1 to be able to
directly output XML to clients... don't you?
A better solution would be to have an independent component that could be
called from servlet1 and servlet2.
> -----Mensaje original-----
> De: Gaël Oberson [SMTP:[EMAIL PROTECTED]]
> Enviado el: jueves 5 de abril de 2001 18:05
> Para: [EMAIL PROTECTED]
> Asunto: RE: Servlet Chaining...
>
>
>
> [Gaël Oberson] > I think HttpServletRequest inherits
> getRequestDispatcher(..) from ServletRequest class and does implement it.
> [Gaël Oberson] > You can also get the RequestDispatcher object from
> ServletContext
>
>
>
> Yes, you're right, but it's not what I want to do. the forward
> method sends the request and response objects to another servlet or jsp,
> and the response is entierely created by the second servlet.
>
> The incude method "concatenates" the ouput from servlet 1 & servlet
> 2 in the same response object.
>
> But, in my case, the servlet 1 generates dynamic XML from a
> database, and the servlet 2 (Cocoon) generates HTML FROM servlet1's XML
> data...
>
> Do you see what I mean? The data is processed twice!
>
> Ok. And now how to do that????
>
> The first that can provide me a working solution wins a beer...
>
>
>
> Thx.
>
>
>