There's a request token feature that is not well documented in the Users
Guide. It's used in the example application, and details are in the
JavaDocs. Basically, you set a token for the request when setting up the
form, and then check for it again when it is submitted. The first time
the token will be present and valid, but on subsequent submits it will
not, so you can avoid putting it through again.
It works well, but still leaves the problem of what to do with people
afterwards. The request is still pending, but now the response will
never return to the browser. All you can really do is send them to an
error/message page, hopefully with some link that will let them check
the status of their order. (If that's even available before the response
arrives ;-(
One other thing I do is change the submit label to an ellipse with
Javascript, so there is a visual clue that "Yes, you did press the
button".
<script language="javascript">
<!--
function submitForm(form) {
if (validateScriptForm(form)) {
form.submit.value=" ...";
return true;
}
else return false;
};
// -->
</script>
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/
"Molitor, Stephen" wrote:
>
> Does Struts provide a way to ensure that one user can not execute multiple
> simultaneous requests? I'm thinking of a situation where the users hits a
> 'save' submit button, and, before that request completes, hits a link that
> executes a request to display the data. The view request will not return
> the new data if the save request has not yet completed.
>
> Or, do people avoid this problem by disabling the 'view' link or button
> until the save completes, or something like that?
>
> Thanks.
>
> Steve Molitor
> [EMAIL PROTECTED]