Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

buffer  RSS feed

 
ramy moneiry
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear all
I can not understand why if I have jsp with buffer equal to false (not buffered) and I try to do forwarding to other page through
<jsp:forward page="url" />
why I find an exception IlegalStateException
thanks
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you remove the buffer, then as soon as you output ANYTHING, it will consider the response committed. This means that if the current page (inadvertantly) sends anything, it will be unable to forward to another page.
If you forward from a jsp, it can often consider carriage returns (outside scriptlets tags) as page data, so even though you don't think you have sent anything, you have and the page cannot be forwarded.
Bit of a guess, but this what I see happening if you turn the buffer off and forward from a JSP.
Dave
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!