• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp forward doubt?

 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ranchers,

What it means by saying,

A <jsp:forward> won�t work if

■ There is no buffer (in a JSP, this can be achieved with a page directive, setting the buffer attribute to �none�), and even one character has been written to the response.
■ The buffer has been explicitly flushed (response.flushBuffer()).
■ The buffer has been automatically flushed on filling up (in a JSP, this will happen by default�see the page directive attribute autoFlush for more
information).

If you try to do any of the above, you�ll get an IllegalStateException.
 
Saurabh Kumar
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In all the above 3 conditions, the response would be commited.
So if jsp:forward is used after any of these 3 conditions, it would result in IllegalStateException. So jsp:forward won't work...

Thanks and regards,
Saurabh
 
Yasser Almohammad
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the previous answer was complete.
all three cases commit the response and thus throws IllegalStateException upon forwarding, since the purpose of <jsp:forward> is to transfer the the control to another page after discarding what's written as output in current page.
 
Joe Harry
Ranch Hand
Posts: 10080
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satou,

I got to understand this. Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic