This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes Handling Multiple Submits Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Handling Multiple Submits" Watch "Handling Multiple Submits" New topic

Handling Multiple Submits

SuprajaY Yasoda

Joined: Oct 17, 2005
Posts: 17

I am quite new to Struts. I wrote a java script
function. Which gives user a alert to avoid clicking submit
button again and again

when jsp is submitted from checkAttachStatus function it
is getting submitted, but when I submit it from submits
function isTokenValid(req) is returning false and its not
showing the next, Any suggestion on this Pls. I know that
it returns flase if seesion is missing or token is valied how to check this?
function checkAttachStatus(strValue)
if(document.getElementById ("hdnAttachmentStatus"))
alert("The Files indicated in red did not get uploaded properly. Please upload them again or remove them.");
return false;
//alert("strValue 111: "+strValue)
// alert("strLinkSubmit 111 : "+document.forms[0].strLinkSubmit.value)
// alert("strSubmit 111 : "+document.forms[0].strSubmit.value)

function submits(strValue) {
document.FBAuction.strLinkSubmit.value = strValue;
//document.forms[0].strSubmit.value = strValue;
// alert(confirmed)
if (confirmed==true)
//alert("strLinkSubmit 222 : "+document.forms[0].strLinkSubmit.value)
else if(confirmed==false)
alert("Page Already Submitted,Please wait.");
document.FBAuction.strLinkSubmit.value = strValue;
// document.forms[0].strSubmit.value = strValue;
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Did you ever call saveToken before enterring the jsp? If there is no token to check against it will of course return false.

A good workman is known by his tools.
SuprajaY Yasoda

Joined: Oct 17, 2005
Posts: 17
Thanks for the response, I tried by using saveToken(req, but still am facing the same problem. So I disabled the button after clicking it once, its working for 4,5 jsp's but in once JSP, submit button value is not getting passed to actionbean. Can you please suggest me on this.
wood burning stoves
subject: Handling Multiple Submits
Similar Threads
how to prevent ice:commandButton from submitting if there is a validation error
document.forms[0].submit(); throws Invalid Argument in IE
Prevent the page refreshing
Handle multiple click of an image hyperlink
onsubmit: can you veto form submission without "return false"?