I am redirecting to page after doing some process, however I am getting error:
IllegalStateException: Response has already been committed, be sure not to write to the OutputStream or to trigger a commit due to any other action before calling this method.
How can I solve this?
Thanks in advance.
Cosmos
Never take anything for granted because you never know when you will lose it
U said that there are lot of html statements before redirect. This means that you are writting to the response. There may be a situation in your case that the response is alredy committed ( output is written to the response and it is flushed). Therfore it is throwing an Exception.
You can use a response wrapper to cache the response data in memory (ByteArrayOutputStream) and write it out at the end when you're sure that everything went as planned.
James Carman, President<br />Carman Consulting, Inc.
Ok I will try or I will remove all html code and see whether it works or not, I beleiev if it's only JSP code, it should work without throwing any excpetions.