Closed Bug 72491 Opened 25 years ago Closed 25 years ago

POSTing form with a target causes a GET after POST

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla0.9

People

(Reporter: rdunce, Assigned: adamlock)

References

Details

(Keywords: testcase)

Attachments

(3 files)

POSTing data from a form with a target that causes a new window to pop up sends a GET after the POST operation. Should only be a POST, not a POST then a GET. Only happens when a new window is opened as a result of submitting the form with the method set to POST.
Assignee: rods → pollmann
reassigning
Roger, what build are you using? This was bug 41241, which was fixed on Feb 5...
Build ID: 2001030608
Tried it with : Mozilla/5.0 (X11; U; Linux 2.2.18 i686; en-US; 0.8.1) Gecko/20010319 and does the same thing. POST then a GET.
status to new to get this looked at. Does the get send the form data, or no? (I presume it does not. If it does not, this should have the dataloss keyword)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Not seeing this on yesterday's build 0320 for Windows NT or Linux. Reporter, can you provide more detail on how to reproduce this bug, (e.g. a test case). I tested this with the first testcase on bug 41241.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
I noticed this when developing some JSP pages using tomcat and struts. When looking at the servlet logs I noticed the POST and GET. I tried it with IE5, Netscape 4.7x on Linux and Windows 2000 as well as Opera and they all produce the logs i was expecting. I used you test case as it was with the target as "_blank" and it came back with a method of POST. However...I modified your test case by changing the target to target="newwindow" with no window called "newwindow" present so it would have to be created and it came back with a request method of "GET". If i immediately click the submit button again (i.e The window "newwindow" has been created already and is being displayed) it comes back with a method of POST. It seems to me that when it's not one of the '_' windows(_blank etc) but a named window that doesn't exist that the method of GET comes back. test.html: <body> <form target="newwindow" action="http://pollmann.net/echo.cgi" method="post"> <input type=submit name=sub value=mit> </form> </body>
Reopening. The fix to bug 41241 special-cases _blank and _new. Other named targets still don't work.
Status: RESOLVED → REOPENED
Keywords: testcase
Resolution: WORKSFORME → ---
Attached file Testcase —
reassigning to owner of bug 41241
Assignee: pollmann → adamlock
Status: REOPENED → NEW
I have updated the patch I checked in for GET/POST problems with _new and _blank windows. The new version moves the window opening code to slightly lower down in the nsURILoader::GetTarget routine. Now, if the target is "_blank", "_new", or if the named window cannot be found, the code will create the window and return the window context for the new window to the caller. This causes the POST data to be fed directly into the new window rather than being thrown away with a bogus GET operation being submitted later on. Please try this patch out and append comments. Readers of bug 41241 should post their comments here.
Depends on: 41241
Setting target milestone to 0.9
Keywords: mozilla0.9.1 → mozilla0.9
Target Milestone: --- → mozilla0.9
Tested on Linux x86 and it seems to have solved to the problem I was encountering.
looks good. sr=mscott
Thanks Scott, fix is checked in.
Status: NEW → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Verifying on build 2001-04-10-04-trunk Windows 98
Status: RESOLVED → VERIFIED
*** Bug 80954 has been marked as a duplicate of this bug. ***
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: