我有以下形式的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
無論如何我都會使用隱藏值,但這並不能回答問題。 –