Web/Spring

[Spring] Controller에서 alert 발생 후 redirect 하는 방법

oSsonGo 2021. 7. 23. 10:15
response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<script>alert('로그인을 해 주세요.'); location.href='/login.do';</script>");
out.flush();