[SpringBoot/Thymeleaf] Exception evaluating SpringEL expression EL1007E: Property or field 'id' cannot be found on null

삽질/트러블슈팅 2023. 5. 20. 06:42
728x90
728x90

에러 메세지

 Exception evaluating SpringEL expression EL1007E: Property or field 'id' cannot be found on null

 

 

 

에러 원인

DTO객체를 리턴받아 th:value="${dto.id}"로 주었는데, null을 받아와서 에러 발생

 

 

 

해결

th:value="${dto?.id}

728x90
300x250
mag1c

mag1c

2년차 주니어 개발자.

방명록