<%@page import="board.dto.BoardDTO"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% int seq = Integer.parseInt(request.getParameter("seq")); int pg = Integer.parseInt(request.getParameter("pg")); request.setCharacterEncoding("utf-8"); String subject = request.getParameter("subject"); String content = request.getParameter("content"); BoardDTO dto = new BoardDTO(); dto.setSeq(seq); dto.setSubject(subject); dto.setContent(content); BoardDAO dao = new BoardDAO(); int su = dao.modifyboard(dto); %> boardmodify.jsp

글 수정 확인

"> <%@page import="board.dto.BoardDTO"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% int seq = Integer.parseInt(request.getParameter("seq")); int pg = Integer.parseInt(request.getParameter("pg")); request.setCharacterEncoding("utf-8"); String subject = request.getParameter("subject"); String content = request.getParameter("content"); BoardDTO dto = new BoardDTO(); dto.setSeq(seq); dto.setSubject(subject); dto.setContent(content); BoardDAO dao = new BoardDAO(); int su = dao.modifyboard(dto); %> boardmodify.jsp

글 수정 확인

"> <%@page import="board.dto.BoardDTO"%> <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <% int seq = Integer.parseInt(request.getParameter("seq")); int pg = Integer.parseInt(request.getParameter("pg")); request.setCharacterEncoding("utf-8"); String subject = request.getParameter("subject"); String content = request.getParameter("content"); BoardDTO dto = new BoardDTO(); dto.setSeq(seq); dto.setSubject(subject); dto.setContent(content); BoardDAO dao = new BoardDAO(); int su = dao.modifyboard(dto); %> boardmodify.jsp

글 수정 확인

">
<%@page import="board.dao.BoardDAO"%>
<%@page import="board.dto.BoardDTO"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
int seq = Integer.parseInt(request.getParameter("seq"));
int pg = Integer.parseInt(request.getParameter("pg"));

request.setCharacterEncoding("utf-8");
String subject = request.getParameter("subject");
String content = request.getParameter("content");

BoardDTO dto = new BoardDTO();
dto.setSeq(seq);
dto.setSubject(subject);
dto.setContent(content);
BoardDAO dao = new BoardDAO();
int su = dao.modifyboard(dto);

%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>boardmodify.jsp</title>
<script type="text/javascript">
	window.onload = function(){
		<%if(su > 0) {%>
		alert('글 수정 성공...');
		location.href="boardList.jsp?pg=<%=pg%>";
	<%} else { %>
		alert('글 수정 실패...');
		history.back(-1);
	<%} %>
	}
</script>
</head>
<body>
	<h1>글 수정 확인</h1>
</body>
</html>