【发布时间】:2014-04-10 07:55:14
【问题描述】:
我有一个 HTML 表单如下:-
<form name="login" id="login" action="<%=application.getContextPath()%>/GoogleLogin" method="get">
<input type=hidden id="firstName"/>
</form>
我在 javascript 中设置这个隐藏输入类型的值并将表单提交给 servlet,如下所示:-
<script>
document.getElementById("firstName").value="XYZ";
document.getElementById("login").submit();
<script>
我的表单正在提交,但我无法获取请求参数“firstName”。
http://localhost:8080/Login/GoogleLogin?
感谢您的时间和考虑。
【问题讨论】:
标签: javascript html forms jsp servlets