response already committed problem
843833Oct 2 2001 — edited Oct 3 2001I am useing a servlet as a controller in one of the catch statement I have usign the sendRedirect method to invoke the error page. This statement throws the follwoing error
java.lang.IllegalStateException: response already committed
at weblogic.servlet.internal.ServletResponseImpl.sendRedirect(ServletResponseImpl.java:496)
at Controller.redirectUrl(Controller.java:41)..
.,..........
the code is as follows
try{
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher(url);
//rd.forward(req,res);
throw new ServletException("time pass");
}catch(Exception e)
{
this.res.sendRedirect("/Error.html?ErrorMessage='"+e+"'");
}
this exception is forcefully thrown to check the behaviour of the error page.
any body encountered the same problem..please help..
-Saji