亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

教你使用idea搭建ssm詳細(xì)教程(Spring+Spring Mvc+Mybatis)

 更新時(shí)間:2021年05月23日 15:11:15   作者:CaoPengCheng&  
今天教大家使用idea搭建ssm詳細(xì)教程(Spring+Spring Mvc+Mybatis),文中有非常詳細(xì)的圖文介紹及代碼示例,對(duì)正在學(xué)習(xí)使用idea的小伙伴很有幫助,需要的朋友可以參考下

一、創(chuàng)建maven項(xiàng)目

我使用的是漢化的idea

可以選擇原型,我這里沒(méi)有選擇

在這里插入圖片描述

輸入項(xiàng)目名稱,完成創(chuàng)建

在這里插入圖片描述

二、配置tomcat

選擇運(yùn)行編輯配置

在這里插入圖片描述

點(diǎn)加號(hào)找見(jiàn)tomcat,點(diǎn)擊確定

在這里插入圖片描述

三、添加web模塊

點(diǎn)擊文件進(jìn)入項(xiàng)目結(jié)構(gòu),選擇模塊

在這里插入圖片描述

點(diǎn)加號(hào)找見(jiàn)web,點(diǎn)擊確定

在這里插入圖片描述

四、添加工件

點(diǎn)擊加號(hào)添加,并將可用元素中的jar包,右擊,加入lib中

在這里插入圖片描述

五、為項(xiàng)目添加tomcat的jar包

選擇模塊,選擇項(xiàng)目名

在這里插入圖片描述

選擇web服務(wù)

在這里插入圖片描述

六、idea不會(huì)編譯src下的mapper.xml文件

讓idea編譯器不忽略src下的mapper.xml配置文件,自動(dòng)會(huì)忽略,而sts不會(huì)
在pom文件中加入以下代碼就好

 <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

七、將Spring和Mybatis文件位置

放在resources下

在這里插入圖片描述

八、pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.example</groupId>
    <artifactId>Poject_Stu</artifactId>
    <version>1.0-SNAPSHOT</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>

    <!--讓idea編譯器不忽略src下的mapper.xml配置文件,自動(dòng)會(huì)忽略,而sts不會(huì)-->
    <build>
        <resources>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
            </resource>
        </resources>
    </build>

    <dependencies>
        <!-- spring jar 包-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.3.18.RELEASE</version>
        </dependency>

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

        <!-- mysql 的驅(qū)動(dòng)包-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.17</version>
        </dependency>

        <!--logback 日志包-->
        <dependency>
            <groupId>ch.qos.logback</groupId>
            <artifactId>logback-classic</artifactId>
            <version>1.2.3</version>
        </dependency>

        <!-- mybatis jar 包-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.5.2</version>
        </dependency>

        <!-- 數(shù)據(jù)庫(kù)連接池 alibaba 的 druid  -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.2.3</version>
        </dependency>

        <!-- mybatis與spring整合的jar包-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>2.0.6</version>
        </dependency>

        <!--spring管理的 jdbc ,以及事務(wù)相關(guān)的-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>4.3.7.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>

        <dependency>
            <groupId>javax.servlet.jsp.jstl</groupId>
            <artifactId>jstl-api</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>jstl-impl</artifactId>
            <version>1.2</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet.jsp</groupId>
                    <artifactId>jsp-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.servlet.jsp.jstl</groupId>
                    <artifactId>jstl-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
    </dependencies>
</project>

到此這篇關(guān)于教你使用idea搭建ssm詳細(xì)教程(Spring+Spring Mvc+Mybatis)的文章就介紹到這了,更多相關(guān)idea搭建ssm內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論