728x90
반응형
- 기본적인 사용
예시)
<a th:href="@{http://test.com}"> == <a href="http://test.com">
- 컨텍스트 경로 연관 URL 사용 : 컨텍스트 경로를 myproject로 가정
예시)
<a th:href="@{/test/index}"> == <a href="/myproject/test/index">
※ 파라미터 관련
[사용1]
예시)
<a th:href="@{/test/index(id=1,name='test')}" == <a href="/test/index?id=1&name=test">
[사용2]
예시)
<a th:href="@{/test/{id}/index(id=1,name='test')}"> == <a href="/test/1/index?name=test">
참조: www.thymeleaf.org/doc/articles/standardurlsyntax.html
Standard URL Syntax - Thymeleaf
The Thymeleaf standard dialects –called Standard and SpringStandard– offer a way to easily create URLs in your web applications so that they include any required URL preparation artifacts. This is done by means of the so-called link expressions, a type
www.thymeleaf.org
728x90
'스마트웹앱콘텐츠전문가 > 프레임워크' 카테고리의 다른 글
Ambiguous mapping 에러 처리 (0) | 2021.03.12 |
---|---|
[스프링부트] 프로젝트 구성(생성) 및 작동 원리 (0) | 2020.11.10 |
[mybatis]null, 빈값 체크 (0) | 2020.08.07 |
[spring]ajax 통신 시, post 405 error 조치 (0) | 2018.11.16 |
[4.29]스프링(쿠키+MVC3:날짜 값 변환, @PathVariable, 익셉션 처리) (0) | 2016.04.29 |