You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/03/16 11:40:26 UTC

DO NOT REPLY [Bug 27700] New: - Custom error page is not shown because the buffer is not flushed

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27700>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27700

Custom error page is not shown because the buffer is not flushed

           Summary: Custom error page is not shown because the buffer is not
                    flushed
           Product: Tomcat 4
           Version: 4.1.30
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina:Modules
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: kachun@zonnet.nl


The situation is as follows:

I have spcified a custom error page for error code 500.

	<error-page>
		<error-code>500</error-code>
		<location>/view/error.jsp</location>
	</error-page>

The error page contains very little information, only a message.

I force a 500 error by doing a response.sendError call with the
HttpServletResponse.SC_INTERNAL_SERVER_ERROR code. The error page should be
shown in the browser, but what I get is just the 500 error page of the browser
itself and not my custom page. 

The jsp error page is executed, because I put a breakpoint in my IDE and it
stops in the generated jsp file. No exception is thrown in the jsp.

The strange thing is, if I put arbitrary extra content in my error page, my
custom page is shown in my browser. It seems that if the content exists the
length of the buffer used, this buffer will be flushed and I see my custom error
page. But if the page is not big enough, flushing is not invoked.

I try with a static html file as my custom error page and the same problem
occurs. The page must exceeds a certain length, otherwise it is not shown.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org