일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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
- 명령어
- it
- JSON
- 추천 사이트
- StringUtils.hasText
- 룸북
- 순서 보장
- 스프링부트
- 개발시작전 자세
- 함수 인자값 id
- 타임리프와 스프링
- 비밀번호 변경 명령어
- cmd
- Test 룸북 사용하기
- 타임리프
- 추천 프로그램
- 리눅스
- #{..}
- js
- BindingResult
- 설정
- linux
- 자바스크립트 인라인
- 프로젝트 클린
- Intellij
- 하모니카 OS 5
- 시퀀스 조회
- select
- 다른사람 프로젝트 수정전 가져야할 자세
- Java
Archives
- Today
- Total
웹개발 블로그
[Thymeleaf ] th:feild기능 본문
핵심!! 편리하다!!
<form action="item.html" th:action th:object="${item}" method="post">
<div>
<label for="itemName">상품명</label>
<input type="text"th:feild="${item.itemName}" class="form-control" placeholder="이름을 입력하세요">
</div>
....
</form>
🔽 해당 태그에 이 속성을 넣어주면 돼!
th:feild="${item.itemName}"
또는 (간편하게 작성도 가능)
th:feild="*{itemName}" //(*은 th:object="${item}")에 item을 의미한다)
기능 : id, name, value 속성도 자동으로 만들어준다.
💥그런데
<label for="itemName">상품명</label>
여기서 id="filedName"을 인식하기 때문에 지우면 빨간색으로 바뀌어서!
불편하면 id만 작성해주면 된다!!!
<input type="text" id="itemName" th:feild="*{itemName}" class="form-control" placeholder="이름을 입력하세요">
🔼 요렇게!
'◆Thymeleaf(타임리프) > 기초' 카테고리의 다른 글
비교연산(html 엔티티) (0) | 2023.02.07 |
---|---|
[Thymeleaf] 라디오버튼 + 데이터(Enum)으로 보내기 (0) | 2023.02.04 |
[Thymeleaf 기본 표현 + 사용 선언] (0) | 2023.01.29 |
[Thymeleaf] 타임리프 주석 (0) | 2023.01.26 |
[Thymeleaf] 사용 선언 (0) | 2023.01.26 |