Hi Hans and everybody, I got my answer.

The problem is within my servlet ClientHandler.  I thought if some where in my servlet
it forward to another jsp or servlet (whatsoever) the rest of the code will not be
executed at all.  It seems that is not the case with servlet.  In my case, when the
first time it forward to the retry.jsp, the rest of the servlet code still being
executed. Because I did not branch them properly (I thought they are not going to be
executed anyway so I put the forward /success.jsp as an all time behave) this cause
the second time around "response have already committed error. "

Bad enough, the error message from the browser is completely a misleading. It isn't
that the ClientHandler could not be found, it is within the ClientHandler, it could
not successful do forwarding.

Thanks for all your time and your answers.

-- yi liu

Stefan Bushev wrote:

> it seems that you have no file /ClientHandler
> isn't it /ClientHandler.jsp or something?
>
> s.b.
>
> >From: Liu <[EMAIL PROTECTED]>
> >Reply-To: A mailing list about Java Server Pages specification and
> >     reference <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: why it could not find the servlet the second time around?
> >Date: Mon, 16 Oct 2000 10:02:47 -0400
> >
> >Dear Hans or everybody, please help me to explain what was happened
> >here.
> >
> >I am doing customer registration, when the fields filled out and the
> >customer clicks the summit button, the action will point to a controller
> >jsp (process.jsp), there if the validation is ok, it will forward to a
> >servlet (ClientHandler), which will do one more validation: compare the
> >user_id against the database, if the user_id is already being taken,
> >then the servlet will forward to a retry.jsp to tell the customer to
> >chose a different user_id then summit the form and go through the whole
> >process again.
> >
> >The problem is when the second time it go through the process.jsp it
> >throws me a error on the browser:
> >
> >404 Not Found
> >/zuzupaddles/process.jsp:
> >
> >allaire.jrun.JRunServletException: The page /ClientHandler could not be
> >found.
> >  at allaire.jrun.jsp.JSPParser.generateXML(JSPParser.java:57)
> >  at allaire.jrun.jsp.JSPServlet.parsePage(JSPServlet.java:403)
> >  at allaire.jrun.jsp.JSPServlet.createServlet(JSPServlet.java:375)
> >  at allaire.jrun.jsp.JSPServlet.loadPage(JSPServlet.java:201)
> >  at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:168)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
> >
> >  at allaire.jrun.jsp.JRunPageContext.forward(JRunPageContext.java:333)
> >  at jrun__process2ejspc._jspService(jrun__process2ejspc.java:57)
> >  at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
> >
> >  at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:174)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
> >
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
> >  at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
> >  at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
> >  at allaire.jrun.ThreadPool.run(ThreadPool.java:267)
> >  at allaire.jrun.WorkerThread.run(WorkerThread.java:74)
> >
> >
> >on the err_log file it says:
> >
> >java.lang.IllegalStateException: Response has already been committed
> >  at
> >allaire.jrun.servlet.JRunResponse.resetContent(JRunResponse.java:170)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:874)
> >  at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
> >
> >  at ClientHandler.doPost(ClientHandler.java:50)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:772)
> >  at javax.servlet.http.HttpServlet.service(HttpServlet.java:865)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
> >
> >  at allaire.jrun.jsp.JRunPageContext.forward(JRunPageContext.java:333)
> >  at jrun__process2ejspc._jspService(jrun__process2ejspc.java:57)
> >  at allaire.jrun.jsp.HttpJSPServlet.service(HttpJSPServlet.java:40)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunNamedDispatcher.java:34)
> >
> >  at allaire.jrun.jsp.JSPServlet.service(JSPServlet.java:174)
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1013)
> >  at allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:925)
> >  at
> >allaire.jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:88)
> >
> >  at allaire.jrun.servlet.JRunSE.service(JRunSE.java:1131)
> >  at allaire.jrun.servlet.JvmContext.dispatch(JvmContext.java:330)
> >  at allaire.jrun.http.WebEndpoint.run(WebEndpoint.java:107)
> >  at allaire.jrun.ThreadPool.run(ThreadPool.java:267)
> >  at allaire.jrun.WorkerThread.run(WorkerThread.java:74)
> >
> >
> >But the weird thing here is: if after the user_id changed and I do not
> >summit the form right away, instead  I wait  two minutes or so then
> >summit, there will no complain and the whole process will go through
> >whatever it should branch to.  Could somebody tell me the whole picture
> >that I did not see?
> >
> >The following is the process.jsp:
> >
> >
> ><jsp:useBean id="formHandler" class="ClientBean" scope="request"/>
> ><jsp:setProperty name="formHandler" property="*"/>
> >
> ><%
> >    if (formHandler.validate()) {
> >%>
> ><jsp:forward page="ClientHandler"/>
> ><%
> >    } else {
> >%>
> >  <jsp:forward page="retry.jsp"/>
> ><%
> >    }
> >%>
> >
> >Thanks very much,
> >
> >
> >
> >
> >
> >--
> >
> >Best Regards,
> >
> >Yi Liu
> >
> >===========================================================================
> >To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> >JSP-INTEREST".
> >Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

--

Best Regards,

Yi Liu
Java Programmer

--

Invisible.Ink Corporation
1400 Old Country Road Suite 408
Westbury, NY 11590
Phone: (516) 338 - 5283  Ext.147
Fax: (516) 876 - 8032

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to