John Smith wrote:
> In a servlet you can call either getOutputStream or getWriter but only one,
> calling the other later gets an IllegalStateException. Is there a way of
> finding out what has already been called?
the best solution is to know what you call. There is no point in writing
binary data to a writer. I would say this is also the meaning of the
exception.
Besides that, I'm afraid the only possibility to know that a method has
been called is to catch the exception when you try to call the other one.
|