wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp forward doubt? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp forward doubt?" Watch "jsp forward doubt?" New topic
Author

jsp forward doubt?

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

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.


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Saurabh Kumar
Ranch Hand

Joined: Aug 21, 2006
Posts: 56
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

Joined: Feb 11, 2007
Posts: 12
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.


SCJP<br />SCWCD
Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9345
    
    2

Satou,

I got to understand this. Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp forward doubt?
 
Similar Threads
Is there a maximum size for a JSP?
JSP Page buffering
errorPage doesn't got to new page
response.flushBuffer() and jsp:forward
flush - jsp:include