Closed
Bug 41585
Opened 24 years ago
Closed 24 years ago
Query Search Params Lost on POST of Form
Categories
(Core :: DOM: Core & HTML, defect, P3)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M17
People
(Reporter: randy, Assigned: pollmann)
References
Details
(Whiteboard: [nsbeta2+] fix in hand)
Attachments
(1 file)
(deleted),
text/java
|
Details |
A web page containing a form is accessed via a URL of the
form "http://webserver/servlets/MozTest?xxx=123". When the
user clicks the submit button and the form is posted, the
query params "xxx=123" are lost. This is different behaviour
than both Nav 4.73 and IE 5.x. This makes Mozilla unusable
with our current product.
Example servlet that demonstrates the bug:
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.Enumeration;
// Demonstrates bug in Mozilla build 2000020608
//
// Query parameters are lost on the form POST operation
// This is different behaviour than both Nav 4.7 and IE 5.x.
// To test:
// 1) Invoke using "http://webserver/servlets/MozTest?xxx=123"
// 2) Note the value of the parameter "xxx=123"
// 3) Submit the form by clicking the button
// 4) Note the query parameters are lost!
//
// Randy Gordon, DataChannel, Inc.
// randy@datachannel.com
public class MozTest extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");
out.println("<html>");
dumpParms(req, res);
out.println("<form method=post>");
out.println("<input type=submit>");
out.println("</form>");
out.println("</html>");
}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
res.setContentType("text/html");
out.println("<html>");
dumpParms(req, res);
out.println("</html>");
}
private void dumpParms(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
out.println("<h1>Parameter Values:</h1>");
Enumeration e = req.getParameterNames();
while (e.hasMoreElements()) {
String name = (String)e.nextElement();
out.print(name + " = ");
String values[] = req.getParameterValues(name);
for (int i=0; i<values.length; i++) {
out.print(values[i]);
if (i < values.length-1) out.print(", ");
else out.print("<br>");
}
}
}
}
Reporter | ||
Comment 1•24 years ago
|
||
Comment 2•24 years ago
|
||
updating component and assigning to default owner.
Assignee: asa → rods
Component: Browser-General → Form Submission
QA Contact: jelwell → ckritzer
Assignee | ||
Comment 5•24 years ago
|
||
I have a fix for this in my tree. It's a slight variation on bug 25330 - the
fix was to restrict *that* fix to only GET and not POST!
Status: NEW → ASSIGNED
OS: Windows NT → All
Hardware: PC → All
Whiteboard: fix in hand
Target Milestone: --- → M17
Assignee | ||
Comment 7•24 years ago
|
||
Nominating for beta2. This bug completely breaks some sites that require query
parameters (part of the URL after the ?) to be preserved when posting a form.
There is one dup already but may be more not yet reported.
I have a fix for this bug in my tree and it is a very safe one-line fix to not
chop off the query parameters if we are doing a POST but only if we are doing a
GET.
Keywords: nsbeta2
Comment 8•24 years ago
|
||
Putting on [nsbeta2+] radar for beta2 fix.
Whiteboard: fix in hand → [nsbeta2+] fix in hand
Assignee | ||
Comment 9•24 years ago
|
||
Fix checked in.
To verify, go to the test case from bug 43065:
http://www.bestplaces.net/html/crimecompare2.asp?lstate=MS&rstate=TX
You'll see two list boxes with cities from Mississippi and Texas. Select a city
in each list box, then click the Compare Cities... button. You should see a
page that compares the two cities. If, however, you get:
Microsoft OLE DB Provider for ODBC Drivers error '80040e57'
[Microsoft][ODBC Microsoft Access 97 Driver]Invalid string or buffer length
/html/crimecompare2.asp, line 102
The bug is not fixed.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Comment 10•24 years ago
|
||
Verified Fixed on:
- MacOS9 2000-06-23-08-M17 Commercial
- Linux6 2000-06-23-11-M17 Commercial
- Win98 2000-06-23-09-M17 Commercial
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•