码迷,mamicode.com
首页 > 其他好文 > 详细

Struts2__action中实现先弹窗再跳转;

时间:2015-03-17 14:27:16      阅读:102      评论:0      收藏:0      [点我收藏+]

标签:struts   action   弹窗   跳转   

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中实现先弹窗再跳转;

标签:struts   action   弹窗   跳转   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!