Cobragx
cider7911
2014-09-30 05:22
采纳率: 0%
浏览 857

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个值都能取到。还请各位帮忙分析下

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐