[Mike Atkin]
> > Our development team has been occasionally seeing the following error
> > (listed below) thrown from Orion. This happens when our application
> 
> I had a similar problem when using response.sendRedirect().  I don't know
> whether the same applies to you, but in our our code we had a section like:
> 
> <% if( some_condition )
>     response.sendRedirect(another_url);
> %>
> <html stuff>

ooooohhhhh good point... Now I've been *told* (and no, haven't looked it
up in jsp 1.1 spec like I should :) that once the jsp:forward is called,
no further processing of the current page is allowed to occur, the
forwarded page has to start processing.

Of course, my reference to Location: 302 in my last message obviously was
confused since that's a browser-level redirection (response.sendRedirect,
as you've shown).

This makes more sense (in the buffer-overflow situation), since
the forwarding itself has nothing to do with the headers (since it's
server-side forwarding, not client-side), and hence the content-length
commit is very likely to have happened.

If this turns out to be the problem, it'll be interesting to note that
Tomcat catches the problem and returns "Response already committed"
(although that was still something I had to look up in its faq-o-matic
to figure out what was really going on), where Orion's a little (but not
much) less graceful.

> If the above example is changed to
> 
> <% if( some_condition )
>    {
>       response.sendRedirect(another_url);
>       return;
>    }
> %>
> <html stuff>

I even do the "return;" after jsp:forward's, even though I have a sneaking
suspicion that it's redundant and that I could dig and find the part of
the spec that guaranteed no further processing of the forward-source page.

Thanks, Mike!

James
-- 
James Manning <[EMAIL PROTECTED]>
GPG Key fingerprint = B913 2FBD 14A9 CE18 B2B7  9C8E A0BF B026 EEBB F6E4

Reply via email to