JSP/게시판 만들기
게시판 만들기 - JSP checkSuccess.jsp 게시글을 비밀번호가 일치할 경우 처리를 위한 JSP 페이지(View)
Back
2016. 6. 22. 19:08
JSP checkSuccess.jsp 게시글을 비밀번호가 일치할 경우 처리를 위한 JSP 페이지(View)
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<script type="text/javascript">
if(window.name == "update"){ //만일 새창 이름이 update인 경우
//window opener(open을 해준다)의 parent(부모)는 window의 location.href 주소
//(parent)를 생략하고 사용해도 괜찮다. openr 자체에 window가 있고 open을 해야하기때문에
//opener를 사용
window.opener.parent.location.href =
"BoardServlet?command=board_update_form&num=${param.num}";
}else if (window.name== 'delete'){ //만일 새창 이름이 delete인 경우
alert('삭제되었습니다.');
window.opener.parent.location.href =
"BoardServlet?command=board_delete&num=${param.num}";
}
window.close(); //완료후 닫기
</script>
</body>
</html>