通过控制层返回页面弹窗

效果:
在这里插入图片描述
代码:

public R Demo(HttpServletResponse response)
			throws IOException {
		/*
		 * 业务处理代码
		 */
		String msg = "Success---";
		response.setCharacterEncoding("UTF-8");
		response.setContentType("text/html; charset=utf-8");
		PrintWriter out = response.getWriter();
		out.print("<script>alert('" + msg + "');history.go(-1);</script>");
		return null;

	}

不是很好看,但能用QAQ

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章