Good point.  Here's what I use, based on a tip I picked up from this
list some time ago.  I override the doService() method of the
ApplicationServlet, which is a level I shouldn't be messing with.

public class ApplicationServlet extends
org.apache.tapestry.ApplicationServlet
{
    /** Override doService() to synchronize multiple requests from the same
     *  user, which can happens if the user double-clicks or submits
from two
     *  browser windows sharing the same session.
     */
    protected void doService(HttpServletRequest request,
HttpServletResponse response)
                throws IOException, ServletException
    {
        HttpSession session = request.getSession(false);
        if (session == null) {
            super.doService(request, response);
        } else {
            synchronized (session) {
                super.doService(request, response);
            }
        }
    }
}



Henri Dupre wrote:

>
> I believe that it would be better if tapestry would provide mecanisms to
> synchronize requests from the same user and queue them. This way two
> requests from the same user wouln't be executed simultaneously.
>

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

Reply via email to