posted 11 years ago
I've debugged a little bit in the tomcat sources.
So:
The exception is really thrown, but it goes up till it gets here:
As it is described in the javadoc comment, it gets swallowed.
Why? Because at this moment it sets the status of the response as internat server error, but response has already been committed, so this has no effect at all.
Conclusion:
When we forward to another component after the response has already been committed, next things happend:
- We get an exception logged into the container's log file.
- We get in the output everything that was flushed before the exception has been thrown.
- We don't get a visible error as response.
P.S. That also means that tomcat implementation deviates a little bit from the specification. Doesn't it?
If you think you've done too much, usually it means you've done too few.