์ฐธ๊ณ ์์ : https://youtu.be/Jc9UTY_lcrY
๊ฐ๋ฐํ๊ฒฝ
์ธ์ด : JAVA (JDK 11)
์๋ฒ : Apache Tomcat 9.0
ํ๋ ์์ํฌ : Spring Framework 3.9.18, MyBatis 3.5.8, Bootstrap 5.2.3
DB : OracleXE 11gR2
IDE : sts-3.9.18.RELEASE, SQL Developler
๊ตฌํ๋ด์ฉ
- ๋ฉ์ธํ์ด์ง / ๊ฒ์ํ ๋ชฉ๋ก ๊ตฌํ
- CREATE : ๊ฒ์๊ธ ์์ฑ
<body>
<h2>๊ฒ์ํ ๋ชฉ๋ก</h2>
<table>
<a href="write.do">๊ธ์ฐ๊ธฐ</a>
@RequestMapping(value="/write.do", method=RequestMethod.GET)
public ModelAndView writeExecute(ModelAndView mav) {
mav.setViewName("/board/write");
return mav;
}
<body>
<h1>๊ฒ์๊ธ ์์ฑ ํผ</h1>
</body>
<body>
<form name = "frm" action="write.do" method="post">
<div>
<span>์์ฑ์</span>
<input type="text" name="writer">
</div>
<div>
<span>์ ๋ชฉ</span>
<input type="text" name="title">
</div>
<div>
<textarea rows="10" cols="30" name="content" placeholder="๋ด์ฉ์ ์
๋ ฅํ์ธ์"></textarea>
</div>
<input type="submit" value="์์ฑํ๊ธฐ" id='write'>
</form>
</body>
<insert id="write" parameterType="board.dto.BoardDTO">
INSERT INTO boardBasic (num, writer, title, content, regdate, readcount)
VALUES (boardBasic_num_seq.nextval, #{writer}, #{title}, #{content}, sysdate, 0)
</insert>
@Override
public void write(BoardDTO dto) {
sqlSession.insert("board.write",dto);
}
@Override
public void writeProcess(BoardDTO dto) {
boardDao.write(dto);
}
@RequestMapping(value="/write.do", method=RequestMethod.POST)
public String writeProExecute(BoardDTO dto) {
boardService.writeProcess(dto);
return "redirect:/list.do";
}