Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException- Doubt  RSS feed

 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have a JSP file with the following code:

I'm wondering that why am I not getting a, IllegalStateException here?
I just get to see a page with contents just before the forward call...
Pls. help..
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use errorPage for your page and print exception implicit object in error page and you will get following exception
"java.lang.IllegalStateException: Error: Attempt to clear a buffer that's already been flushed"
 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Gowher...I got it running...but I don't understand that why do I need to explicitly set an error page in the JSP file. However, if you try to call sendRedirect() after calling forward() then in that case we don't have to set any error page.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!