JavaTechie

Its all about Technology

java.lang.IllegalStateException August 8, 2008

Filed under: Java — javatechie @ 6:11 am
Tags: , ,

It is caused by the fact that response.sendRedirect is not the last statement in Servlet to be executed and its embedded in between your business logic i:e after that some function or business logic is continued. So, it should be the last statement otherwise it should return null after redirecting.

eg.

response.sendRedirect(“abc.jsp”);

return;