Search code examples
springrestmaven

What dependency is missing for org.springframework.web.bind.annotation.RequestMapping?


What dependency am I missing? I am currently using:

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-web</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-webmvc</artifactId>
    <version>3.0.5.RELEASE</version>
</dependency>

The error Im getting is: The import org.springframework.web.bind cannot be resolved


Solution

  • the problem's actually caused by dependency. I spent whole the day to solve this prblm. Firstly, right click on project > Maven > add dependency

    enter image description here

    In "EnterGroupId, ArtifactId, or sha1...." box, type "org.springframework".

    Then, from droped down list, expand "spring-web" list > Choose the newest version of jar file > Click OK.enter image description here
    Done!!!