我有以下形式的HTML页面为什么url在GET请求中没有按预期构建?
<form name="input" action="sayHello1.jsp?param1=test1" method="get">
Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>
我在文本框中输入值“测试”并提交。
我希望看到在浏览器提交的URL为
http://localhost:8080/helloWorld/sayHello1.jsp?param1=test1&user=test
,但我看到的网址为
http://localhost:8080/helloWorld/sayHello1.jsp?user=test
为何如此?
您使用哪种浏览器?这与Java无关。 –
我正在使用chrome – emilly
无论如何我都会使用隐藏值,但这并不能回答问题。 –