首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

jsp通过url传递参数解决办法

2013-12-07 
jsp通过url传递参数在第一个jsp页面中script typetext/javascriptfunction chk(id, cla, sts) {if (c

jsp通过url传递参数
在第一个jsp页面中
<script type="text/javascript">
function chk(id, cla, sts) {

      if (confirm("你确定要修改吗?")) {
location.href = "update.jsp?pid=" + id + "&pcla=" + cla + "&psts="+ sts;
}
}
</script>
<td style="overflow:hidden"><input type="button" onclick="chk('<%=roo.getId()%>,<%=roo.getCla()%>,<%=roo.getState()%>')" value="修改" style="width:60;"/></td>

第二个jsp页面

String roomno = request.getParameter("pid");
String cla = request.getParameter("pcla");
String sta = request.getParameter("psts");

点击修改后url为 http://localhost:8080/ResLogin/update.jsp?pid=1,%E8%B1%AA%E5%8D%8E%E5%A5%97%E9%97%B4,l&pcla=undefined&psts=undefined

怎么解决??

热点排行