Project: Tomcat
Bug 43757 Improper parsing of response.sendRedirect() in JSP source
Reported: 2007-10-31 11:55:53 | Status: resolved fixed

Tomcat is throwing a java.lang.illegalStateException due to an attempted response.sendRedirect() after the time for such matters has come and gone... But, this appears to be a symptom of bad .jsp parsing at runtime. ========================== org.apache.jasper.JasperException: Exception in JSP: /buslog.jsp:42 39: // if (session.getAttribute("isAuth") == null) { 40: // session.setAttribute("messageToUser","Authentication failed."); 41: // you.shouldNotParseThis(); 42: // response.sendRedirect("./index.jsp"); 43: // } 44: 45: // if (session.getAttribute("isAuth") != null) { ============================== These lines are commented out in the source, and should not conceivably cause a runtime error. Changing "response.sendRedirect(...)" to "response.sendAbendOMG(...)" suppresses the error. I am willing to provide the complete source if necessary. Build and execution environments are NetBeans 5.5.1 with bundled Tomcat 5.5.17.

Files changed in fix:
java/org/apache/jasper/compiler/ErrorDispatcher.java