I am using a SimpleMappingExceptionResolver that sends all exceptions to an view where it is nicely rendered. That works except one case:
If the user requests a page, and then send and "Abort" (I don't know exactly how that works, but I noticed that if I click an HTTP post form submit button very fast and often the Firefox 7 somehow notify the server that it is not longer interested in the result.) Then the Tomcat 6 rises an ClientAbortException
when one try to render the page, or write the the http response in any kind.
Now starts the trouble: the SimpleMappingExceptionResolver
"catches" the exception and trys to render it nicely to an html page. This then causes in a Stream already closed exception which pollute the log file. (java.lang.IllegalStateException: getOutputStream() has already been called for this response
)
What I have done so fare, is to register the an empty jsp page for the "ClientAbortException". But I feel that this is a Hack. On the other Hand I guess this is not a so uncommen problem, because I will expect it in nearly every spring application that renders all exception. So does anybody have experience with that problem, or has an idea of an not so hacky solution?
<bean
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"
p:defaultErrorView="uncaughtException">
<property name="exceptionMappings">
<props>
<prop key=".MissingServletRequestParameterException">
resourceNotFound
</prop>
<prop key=".ClientAbortException">nothing</prop>
</props>
</property>
</bean>