On Thu, 1 Nov 2001, Hu, Xuebing wrote:
> Date: Thu, 1 Nov 2001 17:39:09 -0500
> From: "Hu, Xuebing" <[EMAIL PROTECTED]>
> Reply-To: Tomcat Developers List <[EMAIL PROTECTED]>
> To: Tomcat Developers List <[EMAIL PROTECTED]>
> Subject: RE: How does Tomcat handle discarded-request
>
> Hi, Craig,
>
> Here is my skeleton jsp,
>
> <jsp:useBean id="workBean" class="..." ...>
> </jsp:useBean>
>
> <%
> Object param1=getParameter("Param1") ;
> ...
> Object paramn = getParameter("Paramn") ;
>
> // let us say that doWork takes a few minutes to finish
> // and I just can not wait at the browser side and I issues another request
>to TOMCAT
> Object result = workBean.doWork(param1, ..., paramn) ;
>
> // Is IOException thrown out here?
> out.println(result) ;
> %>
>
> As per your explaination, is IOException thrown out on
> out.println()???, since it is JSP, so my workBean has no way to talk
> to something at the browser side to get data.
>
Clarification - *if* the IOException is thrown, it would be thrown on
either an out.println() or out.flush() method call -- or perhaps not until
the response is actually committed -- and maybe not even then.
My feeling is that it will be so rare that you can detect a cancelled
request, in time to do something about it, that it's not really worth
programming for this case on the output side. What I'd spend more time
thinking about is dealing with the following sort of use case:
* Buyer selects an item from the catalog and submits
the request to add the item to their shopping cart.
* Buyer presses cancel, thinking that they were going
to change their mind.
* Buyer decides to go ahead and buy anyway, so presses
submit again.
How many times did you add the item to the shopping cart? If your answer
is something other than "once and only once", you've got a problem.
But, this kind of problem is really off topic for TOMCAT-DEV because it is
application related -- so I suggest you take it to other forums (such as
TOMCAT-USER).
> thanks,
> David
>
Craig
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>