jsp页面上有一个多选框控件<select name="web_cert_template" id="web_cert_template">
<option value="1">个人证书模板</option>
<option value="2">单位证书模板</option>
</select>
表单名是<form name="fm1" action="<%=path%>/certApplyAction.do?method=exportCertModel" method="post">通过这个方法提交function selectExportCertType()
{
alert($("#web_cert_template").val());
document.fm1.action = document.fm1.action+"&web_cert_template="+$("#web_cert_template").val();
alert($("#web_cert_template").val());
document.forms[0].submit();
return false;
}
在certApplyAction.do中用这条语句来获取
String certType=request.getParameter("web_cert_template");
当我选择个人证书模板时点击提交
alert($("#web_cert_template").val());弹出显示1
String certType=request.getParameter("web_cert_template");获取的值也是1
但是我这个jsp页面提交后是不关闭的,可以再次提交
当我选择单位证书模板时再次提交时出现了问题
alert($("#web_cert_template").val());弹出显示2
表示控件的值已经变成了2
但String certType=request.getParameter("web_cert_template");获取的值依然是1
没有随着控件的改变而变化,给我的感觉像是这个值传到了缓存中在jsp页面没关闭的时候就不再更新了,
希望各位大大能帮帮忙解释一下,最好能给出解决方案,在线等,多谢了

解决方案 »

  1.   

    加个时间戳试试
    类似于 action = certApplyAction.do?time=Date.getTime();
    保证每试提交的ACTION 都不一样。
      

  2.   

    加个时间戳试试
    类似于 action = certApplyAction.do?time=Date.getTime();
    保证每试提交的ACTION 都不一样。
      

  3.   

    加个时间戳试试
    类似于 action = certApplyAction.do?time=Date.getTime();
    保证每试提交的ACTION 都不一样。
      

  4.   

    问题解决了,是执行两次document.fm1.action没重置,参数就叠加了两次,多谢了