• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP and java bean deployment  RSS feed

 
Mike Han
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a jsp page and its related java bean for form validation in Jbuilder4,in JBuilder ide they seem to work well.But when I deploy them in tomcat, I always get "IllegalStateException:Response has already been committed"
can any body give me a clue what might be wrong?
Thanks in advance.
Mike
 
Jason Kilgrow
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmmm...that's not a lot of info to go on.
Where does it say the error occurs? In the jsp or in the bean?
Without knowing a bit more about each of your components, and maybe seeing the stack trace (I'm assuming there is one) it's rather difficult to debug.
Maybe you could try to create a small error.jsp, set it as your errorPage and when it hits the errorPage, dissect the request, the exception, and the session objects to see what's inside of them. Get the parameter names and values from the request and session and display them on your errorPage so you can see what you are dealing with.
Originally posted by Mike Han:
I made a jsp page and its related java bean for form validation in Jbuilder4,in JBuilder ide they seem to work well.But when I deploy them in tomcat, I always get "IllegalStateException:Response has already been committed"
can any body give me a clue what might be wrong?
Thanks in advance.
Mike

 
Raghav Sam
Ranch Hand
Posts: 412
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Mike Han:
I made a jsp page and its related java bean for form validation in Jbuilder4,in JBuilder ide they seem to work well.But when I deploy them in tomcat, I always get "IllegalStateException:Response has already been committed"
can any body give me a clue what might be wrong?
Thanks in advance.
Mike

A number of methods of the javax.servlet package throw this exception. But I guess your problem arises due to the forward() method of the RequestDispatcher object. The servlet specification 2.3 says that "forward should be called before the response has been committed to the client (before response body out-put has been flushed). If the response already has been committed, this method throws an Illegal-StateException."
Hope this helps.

------------------
Raghav.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!