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

后端 未结 16 2048
名媛妹妹
名媛妹妹 2020-12-28 13:52

What dependency am I missing? I am currently using:


    org.springframework
    spring-w         


        
相关标签:
16条回答
  • 2020-12-28 14:15

    Sometimes there is some error in the local Maven repo. So please close your eclipse and delete the jar spring-webmvc from your local .m2 then open Eclipse and on the project press Update Maven Dependencies.

    Then Eclipse will download the dependency again for you. That how I fixed the same problem.

    0 讨论(0)
  • 2020-12-28 14:18

    This solution WORKS , I had the same issue and after hours I came up to this:

    (1) Go to your pom.xml

    (2) Add this Dependency :

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


    (3) Run your Project

    0 讨论(0)
  • 2020-12-28 14:18

    I had the same problem but I solved in other way (becouse at right click on project folder no Maven tab apears only if I do that on pom.xml I can see a Maven tab):

    So I tink that you get that error because the IDE (Eclipse) didn`t import the dependecies from Maven. Since you are using Spring framework and you probably have STS allready installed right-click on project folder Spring Tools -> Update Maven Dependecies.

    I`m using Eclipse JUNO m2eclipse 1.3.0 Spring IDEE 3.1

    0 讨论(0)
  • 2020-12-28 14:21

    Go to pom.xml

    Add this Dependency :

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

    using command prompt, find your folder: - mvn clean

    0 讨论(0)
  • 2020-12-28 14:23

    I don't think the problem is the dependencies. I guess you are getting that error on your IDE. Then just refresh it. If it's eclipse, try running Maven->Update Dependencies

    0 讨论(0)
  • 2020-12-28 14:23

    To resolve, Update Spring Frame Work to 3.2.0 or above!

    0 讨论(0)
提交回复
热议问题