<%@ page import ="java.io.*" %>
response.setContentType("text/html; charset=UTF-8");
PrintWriter writer = response.getWriter();
writer.println("<script>alert('정보를 저장했습니다.'); location.href='blah.jsp';</script>");
writer.close();
와 같이 작성하면 알림창이 뜬다.
그리고
response.sendRedirect("blah.jsp")으로 이동할 페이지를 작성하는 것 대신에
위 처럼 작성해주어야 한다.
실제 적용해서 사용한 모습 :
확인을 누르면 location.href에 작성한 페이지로 이동한다.
'강의 > 지능웹설계' 카테고리의 다른 글
[jsp:eclipse] 지능웹설계 : multipartRequest 이용해서 파일 업로드 시에 절대경로 말고 상대경로 이용해서 업로드 하는 방법 (0) | 2021.11.26 |
---|---|
[jsp:eclipse] j_security_check 사용 중 HTTP 상태 408 – 요청 제한 시간 초과 뜨는 경우 (1) | 2021.11.24 |
[eclipse] failed while installing Java 14. error (0) | 2021.11.21 |
[eclipse] 이클립스 MySQL 연동하기 jsp ch15 database (2) (0) | 2021.11.17 |
[eclipse] MAC os M1 MySQL을 이클립스에 연동하기 (1) (0) | 2021.11.17 |