What dependency is missing for org.springframework

2020-02-21 03:49发布

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

14条回答
SAY GOODBYE
2楼-- · 2020-02-21 04:24

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

查看更多
兄弟一词,经得起流年.
3楼-- · 2020-02-21 04:28
<dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
查看更多
forever°为你锁心
4楼-- · 2020-02-21 04:32

Add this below dependency in your pom.xml

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

This is used for @RestController, @RequestMapping

查看更多
爱情/是我丢掉的垃圾
5楼-- · 2020-02-21 04:33

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.

查看更多
爱情/是我丢掉的垃圾
6楼-- · 2020-02-21 04:33

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.

查看更多
一夜七次
7楼-- · 2020-02-21 04:35

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

查看更多
登录 后发表回答