써먹는 웹개발
[Thymeleaf] org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'name' cannot be found on null 본문
Client/Thymeleaf
[Thymeleaf] org.springframework.expression.spel.SpelEvaluationException: EL1007E:(pos 0): Property or field 'name' cannot be found on null
kmhan 2021. 8. 9. 17:01728x90
반응형
1. 나의 경우 파라미터에 @ModelAttribute("queryParam") QueryParams queryParams 가 없었다.
1
2
3
4
5
|
@GetMapping(value = {"", "/"})
public String forwardMain(Model model,
@ModelAttribute("queryParams") QueryParams queryParams) {
return "views/main/index";
}
|
cs |
2. 백앤드에서 문제가 없는데 프론트에서 문제가 생기는 경우
- name의 상위 변수 뒤에 ?를 붙여줄 것
1
|
${member?.name}
|
cs |
2번 참고 : https://spacedev.tistory.com/7
728x90
반응형
'Client > Thymeleaf' 카테고리의 다른 글
[Thymeleaf] DataTable에 목록 조회를 Map 리턴과 model 전송하는 각각의 방법 (0) | 2021.12.21 |
---|
Comments