• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error pages

 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic