
▶ 오류메세지: /WEB-INF/views/home.jsp (line: [1], column: [1]) JSP file [/WEB-INF/inc/top.jspf] not found
하루 종일 나를 괴롭혔던 오류중에 하나.... jsp를 읽지 못한다는 에러가 떴다..
▶ 해결방법:
1. 컨트롤러 생성 확인
@RestController
public class BoardController {
@Inject
BoardService service;
@GetMapping("/board/boardList")
public ModelAndView allSelect() {
ModelAndView mav = new ModelAndView();
mav.addObject("lst",service.allSelect());
mav.setViewName("/board/boardList");
return mav;
}
}
2. JSP 를 src/main/webapp/WEB-INF/views 에 위치
나는 여기서 해결했다..


경로가 잘못됐던걸로....
2. application.properties 에 선언
spring.mvc.view.prefix: /WEB-INF/views
spring.mvc.view.suffix: .jsp
3. 의존성 추가 (gradle)
compile('org.apache.tomcat.embed:tomcat-embed-jasper')
compile('javax.servlet:jstl:1.2')
(한 다음엔 꼭 Gradle > Refresh Gradle Project)
▶ 참조블로그: https://dogcowking.tistory.com/326
'Back-End > Spring' 카테고리의 다른 글
| [SpringBoot][오류] Duplicate entry 'goguma' for key 'member.PRIMARY' (0) | 2022.03.24 |
|---|---|
| [SpringBoot] 이미지 적용(경로추가)하는 방법 (0) | 2022.03.24 |
| [SpringBoot][오류] To display the conditions report re-run your application with 'debug' enabled (0) | 2022.03.23 |
| [SpringBoot][오류] Invalid bound statement (not found): (0) | 2022.03.23 |
| [Spring][오류] Field 'no' doesn't have a default value (0) | 2022.03.21 |