首页 > 其他 > 详细

Struts2__action中实现先弹窗再跳转;

时间:2015-03-17 14:24:09      阅读:281      评论:0      收藏:0      [点我收藏+]

HttpServletResponse response = ServletActionContext.getResponse();

response.setContentType("text/html;charset=UTF-8");

response.setCharacterEncoding("UTF-8");//防止弹出的信息出现乱码

PrintWriter out = null;

try {

    out = response.getWriter();

    out.print("<script>alert(‘抱歉,您的链接已失效,您可以返回首页重新申请‘)</script>");

    out.print("<script>window.location.href=‘/index.action‘</script>");

    out.flush();

    out.close();

    

catch (IOException e) {

    e.printStackTrace();

}

return null;

本文出自 “艺晨光的博客” 博客,请务必保留此出处http://ycgit.blog.51cto.com/8590215/1621392

Struts2__action中实现先弹窗再跳转;

原文:http://ycgit.blog.51cto.com/8590215/1621392

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!