-
Notifications
You must be signed in to change notification settings - Fork 0
/
Html.txt
79 lines (56 loc) · 2.18 KB
/
Html.txt
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
======================================================================================================================
html with spring
------------------------------------------------------------------------------------------------------
서버로 html변수값 전달
html
<form action="주소" method="post">
이메일 : <input type="text" name="email"><br>
비밀번호 : <input type="text" name="password"><br>
</form>
controller
@PostMapping("주소")
public String update(@ModelAttribute MemberDTO memberDTO) {
memberService.update(memberDTO);
return "/member/"
}
-전송내용 form에 담아 전달하고 form 주소와 @ModelAttribute로 받음
url에 값을 담아 보내기
html
<a th:href="@{|/member/${member.id}|}">
controller
@GetMapping("/member/{id}")
public String findById(@PathVariable(name = "id") Long id) {
return "detail";
}
서버 값 html변수로 전달
controller
@GetMapping("/member/")
public String findAll(Model model) {
MemberDTO memberDTO;
model.addAttribute("member1, memberDTO);
List<MemberDTO> memberDTOList = memberService.findAll();
model.addAttribute("memberList", memberDTOList);
return "list";
}
html
<td th:text="${member1.memberEmail}"></td>
(리스트의 경우 반복문사용)
<tr th:each="member2 : ${memberList}">
<td th:text="${member2.name}">이름</td>
<td th:text="${member2.email}">이메일</td>
</tr>
-list.html에서 "member : ${memberList}"활용해서 받기
-------------------------------------------------------------------------------------------------------------------------------
deep html
----------------------------------------------------------------------------------------------------------------------------
</h1>, </h2>..글씨 크게(글 제목), 숫자 커질수록 글씨 작아짐
<hr> 가로선그리기
<br> 줄바꿈
<p>본문 글씨쓰기
//리스트
<ul>
<li><a href="#history">커피의 역사</a></li>
<li><a href="#menu">커피 메뉴</a></li>
</ul>
// iframe : 다른 주소의 웹페이지를 보여줌, size조절가능
<iframe src="/Example_02/sub_o1_coffee_menu.html" frameborder="0" ></iframe><br>