zoukankan      html  css  js  c++  java
  • SpringBoot添加WEB模块

    添加Web模块

    打开Structure,在Modules中添加Web模块,并配置好web.xml喝web根路径

    Package到jar中

    上面的添加好后直接运行在浏览器中可以访问,package打包成jar包后发现访问不了,原因是没把webapp模块打包到jar中。

    在pom文件的build节点下添加resource配置,目的是将webapps下的目录打包到jar文件的META-INF esources目录下

        <build>
            <plugins>
                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
            </plugins>
            <resources>
                <resource>
                    <directory>src/main/webapp</directory>
                    <targetPath>META-INF/resources</targetPath>
                    <includes>
                        <include>**/**</include>
                    </includes>
                </resource>
                <resource>
                    <directory>src/main/resources</directory>
                    <includes>
                        <include>**/**</include>
                    </includes>
                    <filtering>false</filtering>
                </resource>
            </resources>
        </build>

  • 相关阅读:
    凝聚层次聚类
    Kmeans
    贝叶斯数据集
    将项目上传至码云(命令)
    协同过滤算法
    在阿里云Centos7.6上部署Supervisor来监控和操作各类服务
    Django笔记
    高并发
    FastDFS
    关于数据结构
  • 原文地址:https://www.cnblogs.com/aeolian/p/12494534.html
Copyright © 2011-2022 走看看