Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error pages

 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to everybody,
I have a little doubt about error handling mechanism.
Suppose that we have a servlet that:
1. Writes something to the writer and flushes it
2. Throws an error after the flush

Suppose that the error is managed by the application server.

How can the application server send an error page if the content of the servlet that has thrown the error has already sent something to the client? It's too late to either dispatch a request or send a redirect to the client...

Thank you in advance!
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi to everybody,

I have had some tries before knowing that, with Apache Tomcat at least, if the response is partially committed, any exception cannot be managed (no error page is received, and obviously the status code is not set). Everything after the error is ignored.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic