form submitting twice problem inFireFox3.0b5

Discussion about official Mozilla Firefox builds
Post Reply
stonecheung
Posts: 3
Joined: May 16th, 2008, 1:38 am

form submitting twice problem inFireFox3.0b5

Post by stonecheung »

This bug appeared in my struts-based web application, here is the detail:


I have a jsp(let's say Page1) contains two forms(FormA, FormB), FormA and FormB have different "id" and "action" properties: FormA's "action" equals Page1's url, and FormB points to another url.


When I click the sumit button of FormA, the target struts-action executed and returned back to Page1, then I watched a wired thing: the returned Page1 submits the formA again(of course, the target struts-action executed AGAIN!), and it seems that FireFox automatically do the second submission.

As a result, my struts-action executed twice: first due to the user's submission operation, and it's normal; but second is unexcepted, and I don't know why FireFox will do this.

But if I remove the FormB or remove the FormB's "action" attribute, FireFox will act well.

So I wonder how FireFox process pages that contain the multi forms.

It's there anyone encounting the similar problem?

Thanks for your attention and reply!
stonecheung
Posts: 3
Joined: May 16th, 2008, 1:38 am

Post by stonecheung »

And importantly, Other explorers(I've tested IE7 and opera9) don't have this problem,
User avatar
steviex
Moderator
Posts: 28902
Joined: August 12th, 2006, 8:27 am
Location: Middle England

Post by steviex »

Moving to Firefox Builds, where Firefox 3 is discussed....

Remember that Firefox 3 BETA 5 is still only a TEST version of Firefox, so it is possible that this is broken...
Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. -Albert Einstein

Please DO NOT PM me for support... Lets keep it on the board, so we can all learn.
User avatar
Bluefang
Posts: 7857
Joined: August 10th, 2005, 2:55 pm
Location: Vermont
Contact:

Post by Bluefang »

I'm guessing it's probably a bug in the site code, but, of course, I can't tell unless I can see some code. Do you have an example page?
There have always been ghosts in the machine... random segments of code that have grouped together to form unexpected protocols. Unanticipated, these free radicals engender questions of free will, creativity, and even the nature of what we might call the soul...
stonecheung
Posts: 3
Joined: May 16th, 2008, 1:38 am

Post by stonecheung »

Thanks for your reply, I've solved it!

The reason is that there's a tag of img with "src" property equals "" in the page code, FireFox will think this img's src is current url, so it visit the url again, but other explorers will do nothing in this condition.

I searched the forum and found this problem has been post before:
FireFox Submits Forms Twice?: http://forums.mozillazine.org/viewtopic.php?p=3022038&

I also found a web link that would be heapful.
How Firefox Handles Empty SRC tags: http://geekswithblogs.net/bcaraway/arch ... 14945.aspx
Post Reply