自学内容网 自学内容网

springboot 打包部署jsp页面两种方式war/jar

springboot 两种部署方式jsp页面

war包部署jsp页面

我们是用传统的war包,放到 tomcat的webapp目录里面,当容器启动的时候,会自动解压.war 文件,从而进行访问,但是 springboot 是内嵌的tomcat,所以我们需要排除内嵌的tomcat 使之失效

1、排除依赖jar包

  <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
            <scope>provided</scope>   <!--去掉内嵌tomcat-->
        </dependency>

        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
            <scope>provided</scope>  <!--去掉使用内嵌tomcat解析jsp-->
        

原文地址:https://blog.csdn.net/qq_36260963/article/details/142719400

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!