struts中jsp向action传参的长度的问题

在action中定义了一个 String[] partIds 的对象;
前台页面查询出结果后 根据用户勾选中的结果清单 把它们的id传到后台

.... function passIds() { var temp = new Array(); var selectedPart= "?"; checkBoxArray = document.getElementsByName("mcdBean.partIds"); for(i = 0; i < checkBoxArray.length; i++){ if (checkBoxArray[i].checked){ temp[i] = checkBoxArray[i].value; selectedPart = selectedPart + "partIds=" + temp[i] + "&"; } } window.open("******.do"+ selectedPart,"xxxxName","width=950,height=600,scrollbars=yes,toolbar=no,location=no,menubar=no,resizable=yes,titlebar=yes,status=yes"); }

现在有一个问题就是 当 有50个partId就传不了,我看了一下,第50个id就传了一半(id为字符串)意思就是当大于50个后台的partIds 就接受不完了。怎么解决这个问题呀??? 我要传200个或更多的id到后台?

请帮忙解答。谢谢

get传参有长度限制的,改成post就好了,如果只能用get,只传递最需要的参数,没用的就不要传了

你这个需求真是BT。建议给成form提交,不过给成form后你的window.open弹出页面怎么样呢?或者你放弃弹出页面!

用了post更少?不是吧,post提交没有限制的,我用了400个相同name的input框测试都没有问题。