0
点赞
收藏
分享

微信扫一扫

快速创建一个SpringMVC项目(IDEA)

陆佃 2022-04-24 阅读 71

1,创建一个一般的Maven工程

在工程中添加依赖

<dependencies>
        <!-- SpringMVC -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>5.3.1</version>
        </dependency>
        <!-- 日志 -->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
        </dependency>
        <!-- ServletAPI -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>3.1.0</version>
            <scope>provided</scope>
        </dependency>
        <!-- Spring5和Thymeleaf整合包 -->
        <dependency>
            <groupId>org.thymeleaf</groupId>
            <artifactId>thymeleaf-spring5</artifactId>
            <version>3.0.12.RELEASE</version>
        </dependency>

<!--        json依赖-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>2.12.1</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>2.12.1</version>
        </dependency>




    </dependencies>

配置webapp

在这里插入图片描述

点击web

在这里插入图片描述

点击+号为项目添加SpringMVC配置文件

在这里插入图片描述

选择路径

在这里插入图片描述

点击ok即可

如果第一次找到web
那么可以点击添加
在这里插入图片描述

选择web

在这里插入图片描述
接下来接着操作即可

举报

相关推荐

0 条评论