aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Requestdispatcher forward with response commit (flush) does not throw any exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Requestdispatcher forward with response commit (flush) does not throw any exception?" Watch "Requestdispatcher forward with response commit (flush) does not throw any exception?" New topic
Author

Requestdispatcher forward with response commit (flush) does not throw any exception?

mak pandian
Greenhorn

Joined: Jul 06, 2011
Posts: 25

Hi folks,

I am preparing for OCEJWCD 6. As part of my preparation, I tried a sample with request dispatcher with response.flush. But it did not throw any exception. I am using Servlet 3.0 and Tomcat 7.

Is it fixed on Java ee 6?
Saket Barve
Ranch Hand

Joined: Dec 19, 2002
Posts: 229
Can you share the code to see what exactly is going on?
mak pandian
Greenhorn

Joined: Jul 06, 2011
Posts: 25




The above is the piece of code that I wrote on doGet of my serlvelt. Here I used out.write and out.flush before forward. But it does not throw any exception. The weird thing is If I comment out.flush, request dispatcher is working. otherwise whatever I print on doGet gets diplayed on browser.
Joe Allen
Ranch Hand

Joined: Nov 14, 2012
Posts: 93
Did you check log file?


"There are no dumb questions" quoted from HFSJ. "To err is human; to forgive is divine"
OCPJP 6, OCEJWCD 6
mak pandian
Greenhorn

Joined: Jul 06, 2011
Posts: 25

Hi Joe Allen,

That s what I forgot it. I checked logs and it clearly showed me the stack trace.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Requestdispatcher forward with response commit (flush) does not throw any exception?
 
Similar Threads
Babe Ruth - constructor
Distinguishing b/w programmer thrown exceptions and JVM thrown exceptions.
Question on shift operators in SCJP exam
Exception
invalidMonitorState