• Post Reply Bookmark Topic Watch Topic
  • New Topic

IllegalStateException

 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

When forwarding from a Login Servlet to another servlet using the RequestDispatcher forward() method, I get the IllegalStateException: response has already been committed error.

From what I've read, once a servlet is invoked, the response object and it's buffers are completely empty and as such there shouldn't be anything in them to have the "committed" flag toggled as far as I know. This article was my reference ( http://www.jguru.com/faq/view.jsp?EID=501393 )

In my servlet, a simple login verification is performed and then a user bean is created and added to the session if the user is accepted. From that point, I would like to be able to forward to another servlet but I get this error.

Any suggestions?

Thanks,
Jason
 
Jason Kwok
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just found this article ( http://faq.javaranch.com/view?IllegalStateException ) by SEARCHING, what a concept! I'll be trying this out and hopefully will solve my problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!