반응형
Thymeleaf에서 의 인스턴스 사용
Java를 사용할 수 있는 방법이 있습니까?instanceof
Thymeleaf에 있는 교환원?
다음과 같은 것:
<span th:if="${animal} instanceof my.project.Cat" th:text="A cat"></span>
<span th:if="${animal} instanceof my.project.Dog" th:text="A dog"></span>
시도:
<span th:if="${animal.class.name == 'my.project.Cat'}" th:text="A cat"></span>
또는 스프링을 사용하는 경우:
<span th:if="${animal instanceof T(my.project.Cat)}" th:text="A cat"></span>
타임리프에서 SpEL과 방언을 사용하는 것에 대해 자세히 알아봅니다.
언급URL : https://stackoverflow.com/questions/28783272/use-instanceof-in-thymeleaf
반응형
'programing' 카테고리의 다른 글
코드백에서 자바스크립트 함수를 호출하는 방법 (0) | 2023.08.01 |
---|---|
Oracle ORA-04068의 빈번한 오류: 기존 패키지 상태가 삭제되었습니다. (0) | 2023.07.27 |
동일한 인덱스를 가진 유사한 테이블에서 서로 다른 성능을 갖는 MariaDB (0) | 2023.07.27 |
핸들러 대 비동기 작업 대 스레드 (0) | 2023.07.27 |
마리아에서 변수를 선언하고, 채우고, 사용할 때 고착됨DB (0) | 2023.07.27 |