Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

response already committed problem

843833Oct 2 2001 — edited Oct 3 2001
I 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 31 2001
Added on Oct 2 2001
2 comments
289 views