if(num>0){
out.print("<script>alert('删除成功!');location.href='../listMsg.jsp';</script>");
}else{
out.print("<script>alert('删除失败!');location.href='../listMsg.jsp';</script>");
}
这就是代码,有一个参数需要传递,如何传递 ,传递过去了如何接收,被小脚本利用!!谢谢啦!!
out.print("<script>alert('删除成功!');location.href='../listMsg.jsp';</script>");
}else{
out.print("<script>alert('删除失败!');location.href='../listMsg.jsp';</script>");
}
这就是代码,有一个参数需要传递,如何传递 ,传递过去了如何接收,被小脚本利用!!谢谢啦!!
解决方案 »
- myeclipse debug 问题
- 怎样向非web工程打包成jar文件时 添加依赖jar包?
- java web开发中遇到的问题
- out.println() 输出的js不执行
- websphere下报错:No action instance for path /login could be created、tomcate一切正常,高手进
- 如何控制jsp的等待时间
- 从数据库rs.getDate只能取日期,rs.getTime只能取时间,怎样一起取出来?
- 大家来帮我找茬--关于我的SSH项目(无法跳转),部分代码如下
- 各位兄弟帮忙啊
- 如何获得一个目录下的所有文件的文件名,并存如String[]数组中? 在线等
- 急!在线等!请问这段代码,路径哪里设置错了 ?
- 如何实现动态多文件下载(JSP+Tomcat)
out.print(" <script>alert('删除成功!');location.href='../listMsg.jsp?name="value"'; </script>");
}else{
out.print(" <script>alert('删除失败!');location.href='../listMsg.jsp?name="value"'; </script>");
}
在listMsg.jsp中request.getParamer("name")取
谢谢您的回答,但是:
如果value是个变量呢,再jsp中传值是<%= 变量%>,因为<%%>起了冲突,我就给组合成一个字符串如:("<script>alert('');location.href='../listMsg.jsp?name=<%=变量%"+">';</script>")我这样写没有错吧!!
(" <script>alert('');location.href='../listMsg.jsp?name= <%=变量%"+">'; </script>")
最好把变量先定义了,
如下
<%
String name ="传递过来的值";
%>
(" <script>alert('');location.href='../listMsg.jsp?name= <%=name>>'; </script>")
<%
String Name=request.getParameter("name");out.print("<script language='javascript'>location.href='/../listMsg.jsp?name="+Name+"';</script>");
%>