File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Will the write() method cause the IllegalStateException 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 "Will the write() method cause the IllegalStateException" Watch "Will the write() method cause the IllegalStateException" New topic
Author

Will the write() method cause the IllegalStateException

Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 180
Will the write() method cause the IllegalStateException ? Or only the flush() method causes the IllegalStateException?
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

What write() method are you talking about? Did you check the API?

Regards,
Frits
Balaji Bang
Ranch Hand

Joined: Apr 23, 2007
Posts: 180
Am talking about PrintWriter write method. Will this write() causes IllegalStateException if we are trying to do a forward and the response is already commited.
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1518
    
  22

Am talking about PrintWriter write method. Will this write() causes IllegalStateException if we are trying to do a forward and the response is already commited.

According to the API the write() method will never throw a IllegalStateException.

What will throw an IllegalStateException is the forward on a committed response. Did you check this thread?

Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Will the write() method cause the IllegalStateException
 
Similar Threads
update method not throws DuplicateKeyException!
HF SCJP mock exam question: flush() vs. write()
HF SCJP mock exam question: flush() vs. write()
Generating swing components on fly slow
ServletOutputStream