• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

sendError and sendRedirect

 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys,

I have been going through the HFS&J book and the servlet spec and am trying to figure out when the IllegalStateException will be thrown.

So far, I have found that if the response stream is committed any other attempt to write to it will result in an IllegalStateException, except if it is after a sendError or sendRedirect, in which case it will simply be ignored.

Also any attempt to add a header or content type to the response after it is committed will be ignored.

Any other attempt to write to the response stream will result in an IllegalStateException.

Am I write about this? Are there any other exceptions to the rule?

Thank you for your help. Much appreciated.

Regards,
James.
 
reply
    Bookmark Topic Watch Topic
  • New Topic