2 cobragx Cobragx 于 2014.09.30 13:22 提问

JSP页面提交返回再提交后传值错误问题

页面通过JS提交 ACTION通过传来不同的值进行处理
function myclick(str){
if(str == "shixiao"){
document.forms[0].shixiao.value=str;
document.forms[0].submit();
}
else if(str == "jjshixiao"){
document.forms[0].jjshixiao.value=str;
document.forms[0].submit();
}
}


第一次点shixiao action正常取到shixiao 页面返回后后再点jjshixiao

第二次点的时候
public class PubinfoAction extends DispatchAction {
public ActionForward GetPubinfo(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
PubinfoForm sup = (PubinfoForm) form;
System.out.println("sup.getShixiao() ===" +sup.getShixiao());
System.out.println("sup.getJjshixiao() ===" +sup.getJjshixiao());

打印出来2个值都能取到。还请各位帮忙分析下

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!