Software Workshop

package org.springframework.web.bind.annotation does not exist
package org.springframework.http does not exist

이와 같은 에러가 발생한다면 spring의 web과 관련된 annotation 패키지가 maven dependency에서 누락되어 있기 때문임

이로 인해 RequestMapping, RequestMethod, RequestParam, ResponseBody 등의 annotation이 처리가 되지 않음

다음의 의존성을 pom.xml에 추가하면 됨

Spring MVC

pom.xml

<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-core</artifactId>
</dependency> 
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-web</artifactId>
</dependency> 
<dependency>
  <groupId>org.springframework</groupId>
  <artifactId>spring-webmvc</artifactId>
</dependency>

Spring boot

pom.xml

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