On Tue, 9 Jul 2002, Garg, Sanjay wrote:

> Date: Tue, 9 Jul 2002 10:05:24 -0400
> From: "Garg, Sanjay" <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: IllegalStateException on action chaining
>
> Hi,
>
> I am using Struts 1.1b1 with Websphere 4.02.
>
> In one of my action I am forwarding to another action which in turn forwards
> to the final JSP.
>
> I always get the error pasted below. This does not cause any harm, other
> then cluttering up the log file.
> I have read that the workaround is to use redirect instead of forward for
> the intermediary action.
> But I would prefer to use forward and also avoid this error message.
>

As the error message says, it is not legal to do a
RequestDispatcher.forward() once the original response has been committed.
The fact that you are getting this message implies that you've somehow
created output (enough to cause the response buffer to be flushed) before
doing the forward.

Personally, I'm not a believer in Action chaining -- I think it's better
to abstract the business logic out into bean classes that can be called in
order from a single Action, which then does just a single forward to the
appropriate page.  Others seem to like chaining, however.

> I would appreciate any help.
> Thanks,
> Sanjay

Craig


> -------------------------------- Error message ------------------
>
> [7/8/02 17:04:04:906 EDT] 3ce2be0b WebGroup      X Servlet Error: ERROR:
> Cannot forward. Response already committed.:
> java.lang.IllegalStateException: ERROR: Cannot forward. Response already
> committed.
>       at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
> ispatcher.java:92)
>       at
> org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:97
> 2)
>       at
> org.apache.struts.action.RequestProcessor.processActionForward(RequestProces
> sor.java:408)
>       at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:269)
>       at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
>       at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>       at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>       at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager
> .java:827)
>       at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycl
> eServlet.java:167)
>       at
> com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServle
> t.java:297)
>       at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycle
> Servlet.java:110)
>       at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:47
> 2)
>       at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletMan
> ager.java:1012)
>       at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManag
> er.java:913)
>       at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(W
> ebAppRequestDispatcher.java:523)
>       at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequest
> Dispatcher.java:282)
>       at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestD
> ispatcher.java:112)
>       at
> com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:91)
>       at
> com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.
> java:184)
>       at
> com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedIn
> vocation.java:67)
>       at
> com.ibm.servlet.engine.invocation.CacheableInvocationContext.invoke(Cacheabl
> eInvocationContext.java:106)
>       at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequ
> estProcessor.java:125)
>       at
> com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener
> .java:315)
>       at
> com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.ja
> va:60)
>       at
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:323)
>       at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:252)
>       at com.ibm.ws.util.CachedThread.run(ThreadPool.java:122)
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to