Problem involving jsp:forward
3 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   zulekha_banu
Posted On:   Wednesday, December 8, 2004 01:53 AM

Hi, I m trying to forward from a controller jsp to a JSP page from where the control is again transferred to the controller jsp from here again to a new jsp and so on. The code looks like this: control.jsp: ------------- if(ch==1){ .... ... } if(ch==2){ .... ... } ... .. It works fine for the first forward to test1.jsp but after that throws the following error: java.io.IOException: "Error: Attempt to clear a buffer that's already been flushed" at java.io.IOException.(IOException.java:49) at com.sun.jsp.runtime.JspWri   More>>
			
Hi,
I m trying to forward from a controller jsp to a JSP page from where the control is again transferred to the controller jsp from here again to a new jsp and so on.
The code looks like this:
				
control.jsp:
-------------

if(ch==1){
....
...

}
if(ch==2){
....
...

}
...
..



It works fine for the first forward to test1.jsp but after that throws the
following error:

java.io.IOException: "Error: Attempt to clear a buffer that's already been
flushed"
at java.io.IOException.(IOException.java:49)
at com.sun.jsp.runtime.JspWriterImpl.clear(JspWriterImpl.java:125)
.....

I have tried setting the page buffer and set autoflush property also to
false, still the problem persists.

If You have any idea please share..

Thanks
Zulekha
   <<Less

Re: Problem involving jsp:forward

Posted By:   Anonymous  
Posted On:   Thursday, January 6, 2005 01:43 AM

hi,
as joshi told "you are writing some output before the first forward".check out but don't make autoflush false it gives rise to new errors.

Re: Problem involving jsp:forward

Posted By:   Devendra_Joshi  
Posted On:   Monday, December 13, 2004 04:15 AM

you are writing some output before the first forward.

check it out.... page where you do jsp:forward ..make sure no output has been generated(eg out.println or html tags)

Re: Problem involving jsp:forward

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, December 11, 2004 08:52 AM

I think (?) you better do all your forwarding first, BEFORE writing anything to the response output. Otherwise if you need to mingle output from multiple JSP's, that's what an "include" is for instead of a "forward"!

About | Sitemap | Contact