• Post Reply Bookmark Topic Watch Topic
  • New Topic

Will the write() method cause the IllegalStateException

 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will the write() method cause the IllegalStateException ? Or only the flush() method causes the IllegalStateException?
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Posts: 2791
181
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What write() method are you talking about? Did you check the API?

Regards,
Frits
 
Balaji Bang
Ranch Hand
Posts: 182
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Posts: 2791
181
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!