Notice
Recent Posts
Recent Comments
Link
«   2024/06   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Tags
more
Archives
Today
Total
관리 메뉴

WON.dev

remove 본문

JSP/GuestBook

remove

GAWON 2023. 6. 2. 17:59
<%@page import="org.joonzis.ex.GuestbookDao"%>
<%@page import="org.joonzis.ex.GuestbookVO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix="c"%>    

<% 
	GuestbookVO vo = (GuestbookVO) session.getAttribute("vo");
	int vo1 =  vo.getIdx();
	// dao 를 통해서 실제 삭제
	
	int result = GuestbookDao.delete(vo1);
	
	pageContext.setAttribute("result", result); //저장
%>	    

	<c:choose>
		<c:when test="${result gt 0 }"> 
			<script type="text/javascript">
				alert("방명록이 삭제되었습니다.");
				location.href='index.jsp'; 
			</script>
		</c:when>
		<c:otherwise>
			<script type="text/javascript">
				alert("방명록 삭제를 실패했습니다.");
				location.href='index.jsp'; 
				history.go(-1);
			</script>
		</c:otherwise>
	</c:choose>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

</body>
</html>

'JSP > GuestBook' 카테고리의 다른 글

update  (0) 2023.06.02
update_page  (0) 2023.06.02
romove_page  (0) 2023.06.02
view  (0) 2023.06.02
index  (0) 2023.06.02