On Tue, 1 Feb 2000, Mike Engelhart wrote:
> > What about doing a try-catch around getWriter()? if an illegalstate is
> > caught, we skip it over.
> >
> > What do you think?
>
> OK - first attempt at this works. I'm not 100% confident that this fix is
> the answer to our problems though. Can anyone else with more JSDK internals
> experience determine if this is dangerous...Stefano?? For all I know this
> could be fine.
>
> Anyway here's the change needed to Engine.java to allow the
> HttpServletRequest.getRequestDispatcher(String uri) to be called from within
> an XSP or presumably any Producer.
>
> <CODE>
> // get the output writer
> PrintWriter out = null;
> try
> {
> out = response.getWriter();
> }
> catch(IllegalStateException e)
> {
> // we don't want to write to this or cache the document since
> // presumably it is not complete so lets return
> // from this call to handle()
> return;
> }
> </CODE>
>
> I'll continue to test this as my application requires this functionality
> (RequestDispatcher that is). If we can ensure that this is safe to add,
> lets get this into Cocoon before the next minor/major release so we can
> fully support the JSDK for those using a 2.2 compliant servlet engine.
+1 from me, I'll go ahead and patch this since no one seems to have been
bothered by it yet and it works for me on apache-jserv.
- donald
|