Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ mockup question 1 chapter 5

 
Jan Kostelansky
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have a doubt about error data for mockup question 1 chapter 5
The question is
When using a request Dispatcher, the use of which methods can often lead to an IllegalStateExceltion?
My answer was flush(), which is correct in my oppinion and is correct by the book. However I found in err data that method write() is corroct as well.
However by my experience write() writes only to servet response buffer, which is big enough for most pages not to flush its content to client when write() is called.
What is your oppinion on write() method?
 
Selvaraj Subramanian
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you, only flush() gives IlleagalStateException.
write() from OutputStream, or println() from PrintWriter doesn't throw Exception, it just writes into buffer.

Note: I have tested it with Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic