ERROR - GetMapping cannot be resolved to a type, RequestParam cannot be resolved to a type 해결방법
에러 메시지
GetMapping cannot be resolved to a type
RequestParam cannot be resolved to a type
해결방법
Controller관련 어노테이션(Annotation), Parameter 처리 어노테이션에서 발생하는 에러를 해결할 수 있습니다.
pox.xml 의존성 추가
pox.xml 에 Spring 라이브러리가 추가되어져 있는지 확인한 후 추가하면 해결됩니다.
<dependencies>
<!-- Spring 프레임워크 설치 --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-context --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.0.13.RELEASE</version> </dependency> <!-- Spring MVC 라이브러리 --> <!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.1.6.RELEASE</version> </dependency> </dependencies> |
Mave Project Update
프로젝트 선택 >> 마우스 우클릭 >> [Mave] >> [Update Project…]
해결완료!!!