java.lang.IllegalStateException in Java Servlet

August 8th, 2008No Comments

When response.sendRedirect() is not the last statement in Servlet to be executed and its embedded in between your business logic i.e after response.sendRedirect(), if some function or business logic is continued this exception will be thrown by the java servlet. So, it should be the last statement otherwise it should return null after redirecting.

eg.

response.sendRedirect(“abc.jsp”);
return;

Related Posts:

Tagged : , ,

Comments are closed.