This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hello everybody! I am new to JSP and I am having problems with the <jsp:foward> tag. Here is my situation: I am updating records from a database. The two updates are 1) Modify a db record or 2) delete it. After a successful update i then try to do a jsp foward so that i can go back to the previous page. I always get an error telling me that I cannot clear a buffer which has already been flushed. This is very depressing. It works only if i call jsp foward at the top of the page. I read somewhere that one would normally do a jsp forward before writing to the out object. What's this about?? Please help!!
In a time of drastic change it is the learners who inherit the future. The learned usually find themselves equipped to live in a world that no longer exists.<br />Eric Hoffer
What is your jsp forward stmt? something like this: <jsp:forward page="test.jsp" flush="true"/>
Joined: Aug 27, 2001
Sorry June, if i do as you suggest I get an error. Tomcat is complaining about the flush attribute: can flush=true be used with jsp forward? i thought it could only be used with include? I am using Tomcat 3.2.3. Thanks anyway
To answer your question: "<b>I read somewhere that one would normally do a jsp forward before writing to the out object. What's this about??</b>" You can't forward a jsp page (or a servlet, but they are ultimately the same thing in the end) once the output stream has been committed. (flushed) What this means is that you cannot write to the client's browser and then call the jsp forward tag. (I think) Try not outputting anything on the jsp page that is using forward.