struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Becky Norum <>
Subject Re: java.lang.IllegalStateException: Cannot forward after response hasbeen committed
Date Fri, 28 Mar 2003 03:56:17 GMT
On Thu, 2003-03-27 at 22:38, Craig R. McClanahan wrote:
> There is a fundamental rule in the servlet API that things included with a
> RequestDispatcher.include() call (which is what <jsp:include> does under
> the covers) cannot modify the HTTP headers of the response.  Since you
> need to modify those headers to do a redirect, that's going to be a
> problem for your use case.
> How about doing the include with <%@ include file="..." %> instead?  This
> causes the included logic to become part of the calling page (sort of like
> a #include directive in C/C++), so it can do what you describe (as long as
> it's in the page near the top so you haven't overflowed the output buffer
> yet).  As an extra added bonus, it's a little less overhead to do it this
> way, too :-).
> Craig

*sheepish look*
I doublechecked my pages and turns out I am using <%@ include file="header.jsp" %>.
Thanks for the info - I didn't realise the OH issue or the underlying include

I can work around this issue - but I'm just getting curious/concerned that I'm
doing something fundamentally wrong that will bring up issues later.. 

re: the output buffer - does that include the header file or just this
particular JSP?  The header file can get big.. but again, it works fine before
I follow a certain sequence of actions and return to the first page..

Thanks again,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message