关于getParameter的取值问题 往下一个页面传递ID是怎么传的比如这样打开下个页面:window.open("next.jsp?ID=1"); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 应该不会呀!用request取数的话,只要你的参数传递过来了就一定可以实现取值的。要不然,你用String str = request.getParameter("ID") ;改为:String sql="select * from xuewei where id='"+str+"'";sql="update xuewei set xh='"+C_xh+"',xdm='"+C_xdm+"',xm='"+C_xm+"' where id='"+str+"'";试一试! 说的不是很明白 说清楚一点了 还有你下面的那个id = "+request.getParameter("id") 就可以了 id是int型 第一个页(显示所有数据)<script language="javascript">function Show(ID) { window.open('detail.jsp?ID='+ID,"",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=650,height=500');};</script>第二个页(取出相应id的数据进行修改)用request.getParameter("ID"),正常---------可以取到当前的id第三个页(修改后,写入数据库)sql="update xuewei set xh='"+C_xh+"',xdm='"+C_xdm+"',xm='"+C_xm+"' where id='"request.getParameter("ID")"'";------id='"request.getParameter("ID")"'得到的id为空,不能指定写入 你第二个页面怎么传递ID的?<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">orpage2.jsp?ID=** 第二个页面用 knight_qmh(辉) 方法加一个hidden 的input保留id值,或者用session保存一下id,在第三个页面取出session 用<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">可以向下一页传递参数么?应该放在程序的什么位置?page2.jsp?ID=**(不明白), window.open('detail.jsp?ID='+ID,"……等等部分第二页里面没有 sql="update xuewei set xh='"+C_xh+"',xdm='"+C_xdm+"',xm='"+C_xm+"' where id='"request.getParameter("ID")"'";你的写法有问题吧。request.getParameter("ID")两边怎么没有+呢? ID值在刷新后丢失<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">可以使用隐藏控件在下一页时使用request.getParameter("ID");取值就可以了... 你第一个页面传值到第二页第三页这样直接取当然取不到了在打开第三页时加上参数保留id,或则用其他方式(hidden或则session)都可以啦! id从第一个页怎么传给第二个页的按照同样的方法将id由第二个页再传给第三个页 <input type="hidden" name=ID value="<%=request.getParameter("ID")%>">用这个就可以保留从上一页的ID么?不知道应该放在页面的什么位置?,我还没有改好!我用out.print(request.getParameter("ID"));看了一下,还是没有值 问题解决了,谢谢大家!:)我用的是 <input type="hidden" name="ID" value=<%=id%>>改成<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">就OK了!!! 两表主外键查询,如何在JSP页面调用方法? help:about"功能审计" JSP中所遇到的问题 关于lucene开发的并发操作问题 JSP网页显示问题? 在JSP里面如何控制页面打印阿?? 奇怪的问题,关于打印!!请教各位高手,在线等!! 有关打印的问题 jboss环境: ejb客户端运行出错:NoInitialContextException 数据库导出文章,如何过滤其中的HTML标签 日期类型转化问题?(在线等) jsp的WEB站点与html的WEB站点在IIS中共存的问题
要不然,你用String str = request.getParameter("ID") ;
改为:
String sql="select * from xuewei where id='"+str+"'";
sql="update xuewei set xh='"+C_xh+"',xdm='"+C_xdm+"',xm='"+C_xm+"' where id='"+str+"'";
试一试!
还有你下面的那个
id = "+request.getParameter("id") 就可以了 id是int型
<script language="javascript">
function Show(ID) {
window.open('detail.jsp?ID='+ID,"",'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,width=650,height=500');
};
</script>第二个页(取出相应id的数据进行修改)
用request.getParameter("ID"),正常---------可以取到当前的id第三个页(修改后,写入数据库)
sql="update xuewei set xh='"+C_xh+"',xdm='"+C_xdm+"',xm='"+C_xm+"' where id='"request.getParameter("ID")"'";------id='"request.getParameter("ID")"'得到的id为空,不能指定写入
<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">orpage2.jsp?ID=**
应该放在程序的什么位置?page2.jsp?ID=**(不明白),
window.open('detail.jsp?ID='+ID,"……等等部分第二页里面没有
你的写法有问题吧。request.getParameter("ID")两边怎么没有+呢?
<input type="hidden" name=ID value="<%=request.getParameter("ID")%>">
可以使用隐藏控件
在下一页时使用
request.getParameter("ID");
取值就可以了...
第三页这样直接取当然取不到了
在打开第三页时加上参数保留id,或则用其他方式(hidden或则session)都可以啦!
按照同样的方法将id由第二个页再传给第三个页
用这个就可以保留从上一页的ID么?不知道应该放在页面的什么位置?,我还没有改好!我用out.print(request.getParameter("ID"));看了一下,还是没有值