should I always call isComitted before using sendError. am I right in my assumption.
Peter den Haan
posted 15 years ago
Either that, or handle the IllegalStateException. Which of the two? That depends on how exceptional (rare) the condition would be. If you should not have generated enough content to commit the response, handling the exception is good enough. If on the other hand you might well have generated quite a bit of content, an exception is appropriate and you should check isCommitted() (or, more likely, amend your design so that error conditions are caught before response generation starts; an MVC design usually does the trick). - Peter