MVC
Last updated
Was this helpful?
Last updated
Was this helpful?
Model, View, Controller๋ฅผ ๋ปํ๋ ์ฉ์ด๋ก ๊ฐ๋ฐ ํํ์ ์ผ์ข ์ด๋ค.
Model์ ๋ฐ์ดํฐ๋ฒ ์ด์ค์์ ๊ด๊ณ๋ฅผ ๋ด๋นํ๋ค. ํด๋ผ์ด์ธํธ ์์ฒญ์ ํ์ํ ์๋ฃ๋ฅผ ๋ฐ์ดํฐ๋ฒ ์ด์ค๋ก๋ถํฐ ์ถ์ถํ๊ฑฐ๋, ์์ ํ์ฌ Contoller๋ก ์ ๋ฌํ๋ค.
View๋ ์ฌ์ฉ์ํํ
๋ณด์ฌ์ง๋ UIํ๋ฉด์ด๋ค. ์ฃผ๋ก .jsp
ํ์ผ๋ก ์์ฑํ๋ฉฐ, Controller์์ ์ด๋ค View ์ปดํฌ๋ํธ๋ฅผ ๋ณด์ฌ์ค์ง ๊ฒฐ์ ํ๋ค.
Controller๋ ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ฐ๊ณ , ์ ์ ํ Model์ ์ง์๋ฅผ ๋ด๋ฆฌ๋ฉฐ, Model์์ ์ ๋ฌ๋ ๋ฐ์ดํฐ๋ฅผ ์ ์ ํ View์ ์ ๋ฌํ๋ค.
์์ ์ ๋ถํ ํ์ฌ, ์ถํ ์ ์ง๋ณด์๋ฅผ ๋ ์ข๊ฒ ๋ง๋ ๋ค.
MVC์์ View์ Controller ๊ฐ์ด ์๋ ํํ์ด๋ค. ํ ํ์ผ์ ๊ฐ์ด ์๋ค๊ณ ์๊ฐํ๋ฉด๋๋ค.
ํด๋ผ์ด์ธํธ -> JSP(View + Controller) -> DAO(Model) -> DB
์ด์ ์ ๋ง์ด ์ฐ์ด๋ ๋ฐฉ๋ฒ์ด๋ค.
์ ํต์ ์ธ MVC๋ฅผ ๋ฐ๋ฅด๋ ๋ฐฉ๋ฒ์ด๋ค. Model, View, Controller๊ฐ ๋ชจ๋ ๋ชจ๋ํ ๋์ด ์๋ ํํ์ด๋ค.
ํด๋ผ์ด์ธํธ -> Servlet(Controller)<->Command&DAO(Model)<->DB
ใด> JSP
ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ฐ๋ FrontController๋ฅผ ๋ง๋ค์. ์ฌ์ฉ์์ ์์ฒญ์ ์ง์ค์ํจ๋ค.
package controller;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import command.BCommand;
import command.BContentCommand;
import command.BDeleteCommand;
import command.BListCommand;
import command.BModifyCommand;
import command.BReplyCommand;
import command.BReplyViewCommand;
import command.BWriteCommand;
/**
* Servlet implementation class BFrontController
*/
@WebServlet("*.do")
public class BFrontController extends HttpServlet {
private static final long serialVersionUID = 1L;
/**
* @see HttpServlet#HttpServlet()
*/
public BFrontController() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("FrontController doGet");
actionDo(request,response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
System.out.println("FrontController doPost");
actionDo(request,response);
}
private void actionDo(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
System.out.println("Frontcontroller actionDo");
request.setCharacterEncoding("UTF-8");
String viewPage = null;
BCommand command = null;
String uri = request.getRequestURI();
String conPath = request.getContextPath();
String com = uri.substring(conPath.length());
if(com.equals("/write_view.do")) {
viewPage = "write_view.jsp";
}else if(com.equals("/write.do")) {
command = new BWriteCommand();
command.execute(request,response);
viewPage = "list.do";
}else if(com.equals("/list.do")) {
command = new BListCommand();
command.execute(request,response);
viewPage = "list.jsp";
}else if(com.equals("/content_view.do")) {
command = new BContentCommand();
command.execute(request,response);
viewPage = "content_view.jsp";
}else if(com.equals("/modify.do")) {
command = new BModifyCommand();
command.execute(request,response);
viewPage = "list.do";
}else if(com.equals("/delete.do")) {
command = new BDeleteCommand();
command.execute(request,response);
viewPage = "list.do";
}else if(com.equals("/reply_view.do")) {
command = new BReplyViewCommand();
command.execute(request,response);
viewPage = "reply_view.jsp";
}else if(com.equals("/reply.do")) {
command = new BReplyCommand();
command.execute(request,response);
viewPage = "list.do";
}
// forwarding
RequestDispatcher dispatcher = request.getRequestDispatcher(viewPage);
dispatcher.forward(request, response);
}
}
Command ์ธํฐํ์ด์ค๋ฅผ ๋ง๋ค์ด์ ๊ฐ๊ฐ์ ํด๋์ค๋ฅผ ๋ง๋ค์ด์ค๋ค.
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public interface BCommand {
void execute(HttpServletRequest request, HttpServletResponse response);
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
public class BWriteCommand implements BCommand{
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bName = request.getParameter("bName");
String bTitle = request.getParameter("bTitle");
String bContent = request.getParameter("bContent");
BDao dao = new BDao();
dao.write(bName, bTitle, bContent);
}
}
package command;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
import dto.BDto;
public class BListCommand implements BCommand{
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
BDao dao = new BDao();
ArrayList<BDto> dtos = dao.list();
request.setAttribute("list", dtos);
}
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
import dto.BDto;
public class BContentCommand implements BCommand{
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bId = request.getParameter("bId");
BDao dao = new BDao();
BDto dto = dao.contentView(bId);
request.setAttribute("content_view", dto);
}
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
public class BModifyCommand implements BCommand{
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bId = request.getParameter("bId");
String bName = request.getParameter("bName");
String bTitle = request.getParameter("bTitle");
String bContent = request.getParameter("bContent");
BDao dao = new BDao();
dao.modify(bId,bName,bTitle,bContent);
}
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
public class BDeleteCommand implements BCommand {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bId = request.getParameter("bId");
BDao dao = new BDao();
dao.delete(bId);
}
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
import dto.BDto;
public class BReplyViewCommand implements BCommand {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bId = request.getParameter("bId");
BDao dao = new BDao();
BDto dto = dao.reply_view(bId);
request.setAttribute("reply_view", dto);
}
}
package command;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import dao.BDao;
public class BReplyCommand implements BCommand {
@Override
public void execute(HttpServletRequest request, HttpServletResponse response) {
// TODO Auto-generated method stub
String bId = request.getParameter("bId");
String bName = request.getParameter("bName");
String bTitle = request.getParameter("bTitle");
String bContent = request.getParameter("bContent");
String bGroup = request.getParameter("bGroup");
String bStep = request.getParameter("bStep");
String bIndent = request.getParameter("bIndent");
BDao dao = new BDao();
dao.reply(bId,bName, bTitle, bContent, bGroup, bStep, bIndent);
}
}
๋ฐ์ดํฐ ๋ฒ ์ด์ค์ ๋ฐ์ดํฐ DTO ๊ฐ์ฒด๋ฅผ ๋ง๋ ๋ค.
package dto;
import java.sql.Timestamp;
public class BDto {
int bId;
String bName;
String bTitle;
String bContent;
Timestamp bDate;
int bHit;
int bGroup;
int bStep;
int bIndent;
public BDto() {
}
public BDto(int bId, String bName,String bTitle, String bContent, Timestamp bDate, int bHit,int bGroup, int bStep, int bIndent) {
this.bId = bId;
this.bName = bName;
this.bContent = bContent;
this.bTitle = bTitle;
this.bDate = bDate;
this.bHit = bHit;
this.bGroup = bGroup;
this.bStep = bStep;
this.bIndent = bIndent;
}
public int getbId() {
return bId;
}
public void setbId(int bId) {
this.bId = bId;
}
public String getbName() {
return bName;
}
public void setbName(String bName) {
this.bName = bName;
}
public String getbTitle() {
return bTitle;
}
public void setbTitle(String bTitle) {
this.bTitle = bTitle;
}
public String getbContent() {
return bContent;
}
public void setbContent(String bContent) {
this.bContent = bContent;
}
public Timestamp getbDate() {
return bDate;
}
public void setbDate(Timestamp bDate) {
this.bDate = bDate;
}
public int getbHit() {
return bHit;
}
public void setbHit(int bHit) {
this.bHit = bHit;
}
public int getbGroup() {
return bGroup;
}
public void setbGroup(int bGroup) {
this.bGroup = bGroup;
}
public int getbStep() {
return bStep;
}
public void setbStep(int bStep) {
this.bStep = bStep;
}
public int getbIndent() {
return bIndent;
}
public void setbIndent(int bIndent) {
this.bIndent = bIndent;
}
}
DAO๋ DB๋ฅผ ์ฌ์ฉํด ๋ฐ์ดํฐ๋ฅผ ์กฐํํ๊ฑฐ๋ ์กฐ์ํ๋ ๊ธฐ๋ฅ์ ์ ๋ดํ๋๋ก ๋ง๋ Object์ด๋ค.
package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.util.ArrayList;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.sql.DataSource;
import dto.BDto;
public class BDao {
DataSource dataSource;
public BDao() {
try {
Context context = new InitialContext();
dataSource = (DataSource)context.lookup("java:comp/env/jdbc/javaproject");
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}
}
public void write(String bName, String bTitle, String bContent) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "insert into mvc_board ( bName, bTitle, bContent,bDate, bHit, bGroup, bStep, bIndent) select ?, ?, ?, NOW(),0, MAX(bId)+1, 0, 0 from mvc_board";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setString(1, bName);
preparedStatement.setString(2, bTitle);
preparedStatement.setString(3, bContent);
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
public ArrayList<BDto> list(){
ArrayList<BDto> dtos = new ArrayList<BDto>();
Connection connection=null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try {
connection = dataSource.getConnection();
String query = "select bId, bName, bTitle, bContent, bDate, bHit, bGroup, bStep, bIndent from mvc_board order by bGroup desc, bStep asc";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
resultSet = preparedStatement.executeQuery();
while(resultSet.next()) {
int bId = resultSet.getInt("bId");
String bName = resultSet.getString("bName");
String bTitle = resultSet.getString("bTitle");
String bContent = resultSet.getString("bContent");
Timestamp bDate = resultSet.getTimestamp("bDate");
int bHit = resultSet.getInt("bHit");
int bGroup = resultSet.getInt("bGroup");
int bStep = resultSet.getInt("bStep");
int bIndent = resultSet.getInt("bIndent");
BDto dto = new BDto(bId,bName, bTitle, bContent, bDate,bHit,bGroup, bStep, bIndent);
dtos.add(dto);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(resultSet!=null)resultSet.close();
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
return dtos;
}
public BDto contentView(String strID) {
upHit(strID);
BDto dto = null;
Connection connection=null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try {
connection = dataSource.getConnection();
String query = "select * from mvc_board where bId = ?";
preparedStatement = connection.prepareStatement(query);
preparedStatement.setInt(1, Integer.parseInt(strID));
resultSet = preparedStatement.executeQuery();
if(resultSet.next()) {
int bId = resultSet.getInt("bId");
String bName = resultSet.getString("bName");
String bTitle = resultSet.getString("bTitle");
String bContent = resultSet.getString("bContent");
Timestamp bDate = resultSet.getTimestamp("bDate");
int bHit = resultSet.getInt("bHit");
int bGroup = resultSet.getInt("bGroup");
int bStep = resultSet.getInt("bStep");
int bIndent = resultSet.getInt("bIndent");
dto = new BDto(bId,bName, bTitle, bContent, bDate,bHit,bGroup, bStep, bIndent);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(resultSet!=null)resultSet.close();
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
return dto;
}
public void modify(String bId,String bName, String bTitle, String bContent) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "update mvc_board set bName = ?, bTitle = ?, bContent = ? where bId = ?";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setString(1, bName);
preparedStatement.setString(2, bTitle);
preparedStatement.setString(3, bContent);
preparedStatement.setInt(4, Integer.parseInt(bId));
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
public void delete(String bId) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "delete from mvc_board where bId = ?";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setInt(1, Integer.parseInt(bId));
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
public BDto reply_view(String str) {
BDto dto=null;
Connection connection=null;
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
try {
connection = dataSource.getConnection();
String query = "select * from mvc_board where bId = ?";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setInt(1, Integer.parseInt(str));
resultSet = preparedStatement.executeQuery();
if(resultSet.next()) {
int bId = resultSet.getInt("bId");
String bName = resultSet.getString("bName");
String bTitle = resultSet.getString("bTitle");
String bContent = resultSet.getString("bContent");
Timestamp bDate = resultSet.getTimestamp("bDate");
int bHit = resultSet.getInt("bHit");
int bGroup = resultSet.getInt("bGroup");
int bStep = resultSet.getInt("bStep");
int bIndent = resultSet.getInt("bIndent");
dto = new BDto(bId,bName, bTitle, bContent, bDate,bHit,bGroup, bStep, bIndent);
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(resultSet!=null)resultSet.close();
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
return dto;
}
public void reply(String bId, String bName,String bTitle,String bContent,String bGroup,String bStep,String bIndent) {
replyShape(bGroup,bStep);
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "insert into mvc_board ( bName, bTitle, bContent,bDate, bGroup, bStep, bIndent) values ( ?, ?, ?,NOW(), ?, ?, ?)";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setString(1, bName);
preparedStatement.setString(2, bTitle);
preparedStatement.setString(3, bContent);
preparedStatement.setInt(4, Integer.parseInt(bGroup));
preparedStatement.setInt(5, Integer.parseInt(bStep)+1);
preparedStatement.setInt(6, Integer.parseInt(bIndent)+1);
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
private void replyShape(String strGroup, String strStep) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "update mvc_board set bStep = bStep + 1 where bGroup = ? and bStep > ?";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setInt(1, Integer.parseInt(strGroup));
preparedStatement.setInt(2, Integer.parseInt(strStep));
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
private void upHit(String bId) {
Connection connection = null;
PreparedStatement preparedStatement = null;
try {
connection = dataSource.getConnection();
String query = "update mvc_board set bHit = bHit + 1 where bId = ?";
preparedStatement = (PreparedStatement) connection.prepareStatement(query);
preparedStatement.setString(1, bId);
int rn = preparedStatement.executeUpdate();
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}finally {
try {
if(preparedStatement!=null)preparedStatement.close();
if(connection!=null)connection.close();
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
}
}
ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ํด์ FrontController์์ ์์ ์ ๋ถ๊ธฐํ๊ณ , ํด๋น Commandํด๋์ค๊ฐ ์๋ํ์ฌ DAO๋ฅผ ์ด์ฉํ ๋ฐ์ดํฐ ๋ฒ ์ด์ค ์์ ์ ํ๋ค.
DAOํด๋์ค์ ๊ฒฐ๊ณผ๋ฌผ๋ก DTO๊ฐ์ฒด๊ฐ View(.jspํ์ด์ง)๋ก ์ ๋ฌ๋๋ฉฐ, View์์๋ ํด๋ผ์ด์ธํธ์ ์์ฒญ์ ๋ํ ์๋ต์ผ๋ก ํ๋ฉด(UI)๋ฅผ ๊ตฌ์ฑํ์ฌ ์ถ๋ ฅ ํ๋ค.
<%@ 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>
<table width="500" cellpadding="0" cellspacing="0" border="1">
<form action="modify.do" method="post">
<input type="hidden" name="bId" value="${content_view.bId}">
<tr>
<td> ๋ฒํธ </td>
<td> ${content_view.bId} </td>
</tr>
<tr>
<td> ํํธ </td>
<td> ${content_view.bHit} </td>
</tr>
<tr>
<td> ์ด๋ฆ </td>
<td> <input type="text" name="bName" value="${content_view.bName}"></td>
</tr>
<tr>
<td> ์ ๋ชฉ </td>
<td> <input type="text" name="bTitle" value="${content_view.bTitle}"></td>
</tr>
<tr>
<td> ๋ด์ฉ </td>
<td> <textarea rows="10" name="bContent" >${content_view.bContent}</textarea></td>
</tr>
<tr >
<td colspan="2"> <input type="submit" value="์์ "> <a href="list.do">๋ชฉ๋ก๋ณด๊ธฐ</a> <a href="delete.do?bId=${content_view.bId}">์ญ์ </a> <a href="reply_view.do?bId=${content_view.bId}">๋ต๋ณ</a></td>
</tr>
</form>
</table>
</body>
</html>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!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>
<table width="500" cellpadding="0" cellspacing="0" border="1">
<tr>
<td>๋ฒํธ</td>
<td>์ด๋ฆ</td>
<td>์ ๋ชฉ</td>
<td>๋ ์ง</td>
<td>ํํธ</td>
</tr>
<c:forEach items="${list}" var="dto">
<tr>
<td>${dto.bId}</td>
<td>${dto.bName}</td>
<td>
<c:forEach begin="1" end="${dto.bIndent}">-</c:forEach>
<a href="content_view.do?bId=${dto.bId}">${dto.bTitle}</a></td>
<td>${dto.bDate}</td>
<td>${dto.bHit}</td>
</tr>
</c:forEach>
<tr>
<td colspan="5"> <a href="write_view.do">๊ธ์์ฑ</a> </td>
</tr>
</table>
</body>
</html>
<%@ 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>
<table width="500" cellpadding="0" cellspacing="0" border="1">
<form action="reply.do" method="post">
<input type="hidden" name="bId" value="${reply_view.bId}">
<input type="hidden" name="bGroup" value="${reply_view.bGroup}">
<input type="hidden" name="bStep" value="${reply_view.bStep}">
<input type="hidden" name="bIndent" value="${reply_view.bIndent}">
<tr>
<td> ๋ฒํธ </td>
<td> ${reply_view.bId} </td>
</tr>
<tr>
<td> ํํธ </td>
<td> ${reply_view.bHit} </td>
</tr>
<tr>
<td> ์ด๋ฆ </td>
<td> <input type="text" name="bName" value="${reply_view.bName}"></td>
</tr>
<tr>
<td> ์ ๋ชฉ </td>
<td> <input type="text" name="bTitle" value="${reply_view.bTitle}"></td>
</tr>
<tr>
<td> ๋ด์ฉ </td>
<td> <textarea rows="10" name="bContent">${reply_view.bContent}</textarea></td>
</tr>
<tr >
<td colspan="2"><input type="submit" value="๋ต๋ณ"> <a href="list.do" >๋ชฉ๋ก</a></td>
</tr>
</form>
</table>
</body>
</html>
<%@ 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>
<table width="500" cellpadding="0" cellspacing="0" border="1">
<form action="write.do" method="post">
<tr>
<td> ์ด๋ฆ </td>
<td> <input type="text" name="bName" size = "50"> </td>
</tr>
<tr>
<td> ์ ๋ชฉ </td>
<td> <input type="text" name="bTitle" size = "50"> </td>
</tr>
<tr>
<td> ๋ด์ฉ </td>
<td> <textarea name="bContent" rows="10" ></textarea> </td>
</tr>
<tr >
<td colspan="2"> <input type="submit" value="์ ์ถ"> <a href="list.do">๋ฆฌ์คํธ๋ณด๊ธฐ</a></td>
</tr>
</form>
</table>
</body>
</html>