You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Stéphane Hanser <s....@omegames.com> on 2007/11/19 14:25:31 UTC

Enqueuing users requests

Hi everybody,

 

I’m managing a web application written with Spring. I’m using Apache 2 ->
mod_jk as a load balancer -> Tomcat 5.5

I noticed that users are able to click several times at times and their
actions are queued. But I’d prefer if the server drops any new request if
the first one is not completed. Do you know if it is possible to configure
the system to behave this way ?

 

Thanks in advance,

 

Stéphane Hanser


SV: Enqueuing users requests

Posted by Wilhelmsen Tor Iver <To...@arrive.no>.
> I noticed that users are able to click several times at times and
their actions are queued. But I'd prefer if the server drops any new
request if the first one is not completed. Do you know if it is possible
to configure the system to behave this way ?

A common way to do this is using a "token pattern" where you generate a
token value in the form, and map it to a state you keep in e.g. a static
Map. You test on the token the first thing after submit; if it is "new"
you change state to "in use" and continue processing, otherwise you
either cancel the earlier processing in some manner, or you ignore the
new one. The problem is that unless you use Keep-alive connections that
first processing run will not be able to return anything to the browser
since the first connection has been closed on that second submit.

I haven't used Spring web Flow myself but it could be they already have
a solution to this built in... try looking there first.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org