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

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

What dependency am I missing? I am currently using:


    org.springframework
    spring-w         


        
相关标签:
16条回答
  • 2020-12-28 14:23
    -> Go to pom.xml
    
    -> Add this Dependency :
    -> <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>4.1.6.RELEASE</version>
    </dependency>
    ->Wait for Rebuild or manually rebuild the project
    ->if Maven is not auto build in your machine then manually follow below points to rebuild
    right click on your project structure->Maven->Update Project->check "force update of snapshots/Releases"
    
    0 讨论(0)
  • 2020-12-28 14:24

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

    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.
    Done!!!

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

    I had almost the same problem but it was just because some .jar library wasn't updated.

    I couldn't use @RequestMapping cause that, just "mouse over @RequestMapping" and click on "Fix ..." and the .jar library will be downloading and installing.

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

    Add this below dependency in your pom.xml

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

    This is used for @RestController, @RequestMapping

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