IllegalStateException: Cannot forward after response has been committed ?

hii Servlet experts...

I am looking for some help about this exception..

"java.lang.IllegalStateException: Cannot forward after response has been committed

util.UtilManager.forwarder(Unknown Source)

"

This is the code that I call the method "forwarder"

if (isOk == true)

UtilManager.forwarder("/abc/def/klm.jsp",request,response,getServletContext());

and this is the method "forwarder" ...

public static void forwarder(String path,HttpServletRequest request, HttpServletResponse response,ServletContext context)throws ServletException, IOException

{

RequestDispatcher dispatcher=context.getRequestDispatcher(path);

dispatcher.forward(request,response);

}

I have no idea about why tomcat gices that excepiton about that method...

I am using in inside the Servlet, not in JSP...

As for the duty of the Servlet, I am taking some values from request, and send them to some other methods of other classes, and finally, as a result of these actions, I call the forwarder method to go some appropriate jsp files ...

what is wrong about it ?... where is the missing part ? ..

Thanks..

[1195 byte] By [atopraka] at [2007-10-2 6:15:09]
# 1

Problem Solved.....

There is nothing wrong about the code that I have given...

It was ( I assume !) ... hte other parts of the servlet...

I used many forwarder calls,

I call forwarder call without return statement and then call another ...

then program call another forwarder to forward some diffrent page .. or etc...

then It confuses ... I think ..

:)

atopraka at 2007-7-16 13:16:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
Have you called response.getOutput(), setHeader(), setCookie(), setContentType(), ...? Can't do any of those and then redirect. (I don't have a complete list of things that cause output but I think those are some of them.)
sjasjaa at 2007-7-16 13:16:40 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...