• spring_boot 配置


    配置pom.xml

    <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/maven-v4_0_0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <groupId>spring_boot</groupId>
        <artifactId>spring_boot_day1</artifactId>
        <packaging>war</packaging>
        <version>0.0.1-SNAPSHOT</version>
        <name>spring_boot_day1 Maven Webapp</name>
        <url>http://maven.apache.org</url>
        <!--配置springboot所需的依赖 -->
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.5.3.RELEASE</version>
        </parent>
    
        <dependencies>
            <!--springboot的相关启动 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
    
            <!-- 热部署 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtools</artifactId>
                <optional>true</optional>
                <scope>true</scope>
            </dependency>
    
            <!-- log4j -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-log4j2</artifactId>
            </dependency>
    
            <!-- 使用jasper引擎解析jsp -->
            <dependency>
                <groupId>org.apache.tomcat.embed</groupId>
                <artifactId>tomcat-embed-jasper</artifactId>
                <scope>provided</scope>
            </dependency>
    
            <!-- jsp支持 -->
            <!-- servlet 依赖 -->
            <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>
            <!-- <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> 
                <version>provided</version> </dependency> <dependency> <groupId>javax.servlet</groupId> 
                <artifactId>jstl</artifactId> </dependency> -->
    
            <!-- springboot 整合mybatis -->
            <!-- <dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> 
                <version>1.3.0</version> </dependency> -->
    
            <!-- mysql数据库 -->
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
            </dependency>
        </dependencies>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                    <configuration>
                        <!-- 没有该配置,devtools不生效 -->
                        <fork>true</fork>
                    </configuration>
                </plugin>
            </plugins>
            <finalName>spring_boot_day1</finalName>
        </build>
    </project>

    配置完成后,项目会报错,这时右键项目选择Maven→Update Project;OK!

     配置视图解析器,静态资源访问 application.properties

  • 相关阅读:
    Pale Moon 15.1 发布,苍月浏览器
    开源云端代码编辑器 ACE 1.0 正式发布
    Jailer 4.0.14 发布,智能数据提取工具
    Bitcoin 0.7.0 发布, P2P网络的匿名数字货币
    Pike 7.8.700 发布,脚本编程语言
    PhoneGap 2.1.0 正式版发布
    DHTMLX Touch 1.2 发布,移动 JS 框架
    abcm2ps 6.6.20/7.1.0 发布
    Little CMS 2.4 发布,色彩管理引擎
    Linux静态库和动态库
  • 原文地址:https://www.cnblogs.com/ljc1212/p/9503969.html
Copyright © 2020-2023  润新知