通過控制層返回頁面彈窗

效果:
在這裏插入圖片描述
代碼:

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

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