File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
mak pandian
Ranch Hand
Posts: 30
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 229
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you share the code to see what exactly is going on?
 
mak pandian
Ranch Hand
Posts: 30
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 93
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check log file?
 
mak pandian
Ranch Hand
Posts: 30
Eclipse IDE Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Joe Allen,

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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic