I use the "button" tag with a JavaScript function to submit the form. In form2.jsp, the button has type="submit", after the button is clicked, the javascript function submit the form but IE submit it again since it's a submit button. All other forms use the right button type!
You just can't be too cautious!
-HB
From: "Cox, Charlie" <[EMAIL PROTECTED]>
Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
To: 'Tomcat Users List' <[EMAIL PROTECTED]>
Subject: RE: Duplicate servlet invocation on a single request
Date: Fri, 3 Jan 2003 16:14:17 -0500
are you sure it is calling your servlet twice? I only see one redirect in
the log and I don't see the "entering zzz" at all as defined in your code
sample. This could be that IE sends a HEAD request at the same time as the
POST request. Normally the HEAD request is handled by Tomcat, so it wouldn't
get to your servlet.
Charlie
> -----Original Message-----
> From: hacking bear [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 03, 2003 3:02 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Duplicate servlet invocation on a single request
>
>
> Hi,
>
> I desperately need help. Can someone help me? Thanks.
>
> I copy the log output here. As you can see, thread 3 and 5
> are handling the
> same addRef.do request for the same session.
>
> [DEBUG] (Thread-3) TransactionFilter: session
> 08A98E9D18703D2F3B44E81975F4B387 transaction
> impl.TransactionContext@40f3c1
> request URL /addRef.do
> [INFO] (Thread-3) Joining transaction...
> [DEBUG] (Thread-3) Get into class servlet.AddRefAction:doPost
> request=org.apache.coyote.tomcat4.CoyoteRequestFacade@749ebc
> [DEBUG] (Thread-3) request url: /addRef.do
> [DEBUG] (Thread-5) TransactionFilter: session
> 08A98E9D18703D2F3B44E81975F4B387 transaction
> impl.TransactionContext@40f3c1
> request URL /addRef.do
> [DEBUG] (Thread-3) Submitted parameters:
> [DEBUG] (Thread-3) param: _action value: OK
> [DEBUG] (Thread-3) param: users value:
> uitest.Power_User:1041623306967
> uitest.User:1041623306968
> [INFO] (Thread-5) Joining transaction...
> [DEBUG] (Thread-3) param: contextId value: 8
> [DEBUG] (Thread-5) Get into class servlet.AddRefAction:doPost
> request=org.apache.coyote.tomcat4.CoyoteRequestFacade@618565
> [DEBUG] (Thread-3) param: cancel value: Cancel
> [DEBUG] (Thread-5) request url: /addRef.do
> [DEBUG] (Thread-5) param: _action value: OK
> [DEBUG] (Thread-5) param: users value:
> uitest.Power_User:1041623306967
> uitest.User:1041623306968
> [DEBUG] (Thread-5) param: contextId value: 8
> [DEBUG] (Thread-5) param: cancel value: Cancel
> [DEBUG] (Thread-3) popContext 8
> [DEBUG] (Thread-3) Redirect to
> /jsp/edit.jsp?contextId=7&&model=uitest.User_Group&eo=uitest.U
> ser_Group:1041623306969
>
>
> >From: "hacking bear" <[EMAIL PROTECTED]>
> >Reply-To: "Tomcat Users List" <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Duplicate servlet invocation on a single request
> >Date: Fri, 03 Jan 2003 01:10:25 -0800
> >
> >Hello,
> >
> >I get this interesting behavior. I have HTML forms which posts to
> >servlets, in the order like
> >
> >form1.jsp --post-> MyServlet1 --redirect-> form2.jsp
> > --post-> MyServlet2 --redirect-> form1.jsp
> >
> >Each servlet looks like following:
> >
> >class MyServletX extends HttpServlet {
> > // complete re-entrant, no share access
> > public doPost(request, response) {
> > log.debug("entering "+getClass());
> > // ... process the request, nothing written out
> > String redirectUrl = ....
> > response.sendRedirect(redirectUrl);
> > }
> >}
> >
> >There is also a filter invoked in each step which simply
> sets a variable
> >and pass to the next.
> >
> >But when form2.jsp is submited, Tomcat (latest release 4.1) invokes
> >MyServlet2 twice in different threads for this same request,
> as evident
> >from the log output. Further if I ran tomcat in debugger and place
> >breakpoint in doPost, this would not happen (I have yet to
> try putting a
> >sleeping timer in it). And making the servlet
> SingleThreadModel does not
> >help. While I don't know if this is a threading problem in
> tomcat, invoking
> >the servlet twice on the same requst is real problem.
> >
> >I searched through the mailing list archive, I read that
> request would not
> >be handled by two threads, which I assumed was the case.
> >
> >So what went wrong here? In circumstance would the request
> being processed
> >twice?
> >
> >Thanks.
> >
> >
> >_________________________________________________________________
> >Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> >http://join.msn.com/?page=features/featuredemail
> >
> >
> >--
> >To unsubscribe, e-mail:
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail:
> ><mailto:[EMAIL PROTECTED]>
>
>
> _________________________________________________________________
> Help STOP SPAM: Try the new MSN 8 and get 2 months FREE*
> http://join.msn.com/?page=features/junkmail
>
>
> --
> 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]>
_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE* http://join.msn.com/?page=features/virus
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
