개발/spring-boot

[Spring-boot] @RequestMapping cannot be resolved to a type

CodeDesigner 2021. 11. 3. 08:27

Spring-boot를 import 하자마자 REST API를 구현하기위해 controller안에 ReqeustMapping을 선언했더니 다음과 같은 에러가 발생했다.

 

[에러내용]

@RequestMapping cannot be resolved to a type

 

[해결방법]

pom.xml에 다음을 추가

<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
</dependency>