JavaScript with servlet Get method

JavaScript with servlet Get method

本文关键字:method Get servlet with JavaScript      更新时间:2023-09-26

我在JSP中有以下表单元素:

<form name="testForm" action="./test.do" method="post">
</form>

现在我想用JavaScript提交一个带有servlet get方法的表单。

只需将方法从post改为get。

<form name="testForm" action="./test.do" method="get">
</form>

现在,当提交表单时,数据将使用GET而不是POST参数提交。