Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- Oracle
- autoset
- jsp연결
- 네트워크관리사
- 참조타입
- cisco packet
- jsp
- Java
- 리눅스
- 정처기필기
- html
- 정보처리기사
- 네트워크
- ciscopacket
- 오라클
- NCS
- w3school
- rinux
- 라우터
- VLAN
- sql
- 이것이 자바다
- javaee
- 원형그래프
- 버추얼머신
- 자바
- ospf
- 데이터베이스
- php
- Cisco
Archives
- Today
- Total
기록해! 정리해!
JPAJarTymeleaf-1 UI (getBoardList, form) 본문
1. index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="EUC-KR">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<h2> JPA 시작하기 </h2>
<a href=getBoardList.do>목록보기</a> <br><br>
<a href=form.do>저장하기</a> <br><br>
</body>
</html>
2. getBoardList.html
<html xmlns:th="http://www.thymeleaaf.org">
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<br>
<h2> 목록보기 <a href=index.html>(처음으로)</a></h2>
<table border=1>
<tr>
<td>SEQ</td>
<td>TITLE</td>
<td>WRITER</td>
<td>cnt</td>
</tr>
<tr align="center" th:each="m : ${li}">
<td th:text="${m.seq}" />
<td th:text="${m.title}" />
<td th:text="${m.writer}" />
<td th:text="${m.cnt}" />
</tr>
</table>
</div>
</body>
</html>
3. BoardController
package com.rubypaper.board;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class BoardController {
@Autowired
BoardServiceImpl boardService;
@RequestMapping("/form.do")
public void form() {
}
@RequestMapping("/formOk.do")
public String formOk(Board vo) {
boardService.insert(vo);
return "redirect:getBoardList.do";
}
@RequestMapping("/getBoardList.do")
public void getBoardList(Model model) {
model.addAttribute("li", boardService.getBoardList());
}
}
>>
>>
form (저장하기)
1. form.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<h2>form</h2>
<form action="formOk.do">
<table border=1 >
<tr> <td > 제목 </td><td > <input type=text name=title> </td> </tr>
<tr> <td> 작성자 </td> <td > <input type=text name=writer></td> </tr>
<tr> <td> 내용 </td><td > <input type=text name=content > </td> </tr>
<tr> <td> 암호 </td> <td > <input type=text name=password > </td> </tr>
<tr> <td colspan=2 align="center"> <input type=submit value="저장하기" >
</td>
</tr>
</table>
</form>
</body>
</html>
>>
'SpringBoot' 카테고리의 다른 글
JPAJarTymeleaf-1 검색하기 ( 동적 DSL 사용하기 ) (0) | 2022.10.18 |
---|---|
JPAJarTymeleaf-1 상세보기, 삭제하기, 수정하기 (0) | 2022.10.18 |
JPAJarTymeleaf-1 Test(Crudrepository 메소드사용) (0) | 2022.10.18 |
JPAJarTymeleaf-1 (board) (0) | 2022.10.18 |
JPA - Board(Junit -2) (0) | 2022.10.17 |
Comments