编写servlet的相关问题
2016-04-23 09:00
363 查看
(1) response.setContentType("text/html;charset=utf-8"); PrintWriter writer=response.getWriter(); writer.println("<script>alert('用户名或密码不正确!');window.location.href='adminlogin.jsp';</script>");(2)
response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); out.write("<script language='javascript'>alert('操作失败!');" +"window.location.href='"+request.getContextPath()+"/admin/addprice.jsp?id="+id+"';</script>");这两个都可以在浏览器上成功运行出来,但是由于由于IE与火狐的兼容性问题,有的方法并不能运行出来,总之两个都试试吧
相关文章推荐
- asp.net之extjs
- java基础(16)-- 反应器(Reactor)模式
- 第九周实践-阅读程序,写出程序运行结果并理解(1)
- Retrofit RestAdapter 配置说明
- 机房水题欢乐赛 2016-04-20 上午
- bzoj 1013: [JSOI2008]球形空间产生器sphere(高斯消元)
- linux crash在动态库中,通过map查找crash位置
- C4D to Unity3D插件C2U Tool开源发布!简化你的工作流
- Java的Struts框架中配置国际化的资源存储的要点解析
- oracle sql优化过程
- Shell Step by Step (4) —— Cron & Echo
- 网络服务器开发总结
- org.apache.spark.examples.streaming.StreamingExamples Scala 版本 无Java版本
- 一步步教你安装hadoop
- 写论文第一天:熟悉MATLAB操作
- 腾讯云主机安装LNMP环境及wordpress教程
- POJ_3685_Matrix_(二分,查找第k大的值)
- CodeForces 9D How many trees?
- 小写金额转换大写金额
- POJ_3579_Median_(二分,查找第k大的值)