Originally posted by Randall Twede:
I ran into a problem like that using JDBC
Hmmmm. Would you expect an exception in an object called "HttpServletResponseFacade" because of a JDBC problem? In fact, there is no trace of JDBC in the entire stack trace.
Whenever you call a method that needs to set response header fields, the HttpResponse object will generate an
IllegalStateException if the response has already been committed. "Committed" means that the first chunk of the response -- including the header -- has already been sent off to the client because the buffer was full. Obviously, once you've sent off the header you can't modify it any more
To fix this, make sure you do all your error checking, setting of content type etc. etc. before starting to produce content in earnest. In practice this means: move all this stuff to the very start of your
JSP.
HTH
- Peter
[This message has been edited by Peter den Haan (edited February 16, 2001).]