모델1 게시판 - 글 상세내용 보기 구현

http://injava.tistory.com/14 방법과의 차이점(장단점)을 학습



boardView.jsp

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
31
32
33
34
35
36
37
38
<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<%@ page import="java.sql.*" %>
<%@ page import="service.*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>boardView</title>
</head>
<body>
<h1>BOARD VIEW</h1>
<%
if(request.getParameter("boardNo"== null) {
    response.sendRedirect(request.getContextPath()+"/board/boardList.jsp");
else {
    int boardNo = Integer.parseInt(request.getParameter("boardNo"));
    BoardDao boardDao = new BoardDao();
    Board board = boardDao.selectBoardByKey(boardNo);
%>
    <div>board_no :</div>
    <div><%=board.getBoardNo()%></div>
    <div>board_title :</div>
    <div><%=board.getBoardTitle()%></div>
    <div>board_content :</div>
    <div><%=board.getBoardContent()%></div>
    <div>board_user :</div>
    <div><%=board.getBoardUser()%></div>
    <div>board_date :</div>
    <div><%=board.getBoardUser()%></div>
    <div>
        <a href="<%=request.getContextPath()%>/board/boardModifyForm.jsp?boardNo=<%=board.getBoardNo()%>">수정</a>
        <a href="<%=request.getContextPath()%>/board/boardRemoveForm.jsp?boardNo=<%=board.getBoardNo()%>">삭제</a>
    </div>
<%
}
%>
</body>
</html>
cs


+ Recent posts