This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
well, a 3000 line JSP file is a huge problem that you should probably fix before moving forward. Use the jsp only for output. Try to put things like redirects in the servlet code.
"Response Already Committed" is telling us that the response has already started to write and you are trying to modify it. So, whatever you are trying to do, you must do it earlier, before anything has been written to the response.
A common cause of this problem is simply having a space or carriage return at the top of the JSP. For example, if you have some page directives separated by carriage returns, then those may be put into the response body. Then, if your JSP tries to set something in the header, such as the document type, an exception is thrown. (Remember that the response is just a stream -- the JSP container can't back up and write header data after the page has already started writing the body.) So verify that there are no spaces or carriage returns anywhere in the page above the scriptlet. (There can be carriage returns and spaces within the page directives or scriptlets.) Don't even start the scriptlet "<%" on its own line, since that would mean you'd have a carriage return in the page before the scriptlet code is encountered.
Ravi Kiran Varre wrote:Max, please let me know what is meant by carriage returnds ??
The "return" key. A blank line. Vertical whitespace. CR/LF.
The nutshell version is that you can't redirect/etc. after something's been written to the response, including whitespace.
Echoing an earlier comment: a 3000-line JSP is a horrible idea, and should be fixed, or you will simply continue having difficult-to-diagnose and difficult-to-repair problems.
So in the middle of a 3000-line JSP, you automatically submit the form without the page having much, if any time to be displayed? What's the point of the rest of that JSP? Is it all Java code?