色综合图-色综合图片-色综合图片二区150p-色综合图区-玖玖国产精品视频-玖玖香蕉视频

您的位置:首頁技術文章
文章詳情頁

Spring打包jar包時jsp頁面無法訪問問題解決

瀏覽:114日期:2023-09-05 16:37:15

spring打包jar包時jsp頁面無法訪問

問題如下

Spring打包jar包時jsp頁面無法訪問問題解決

當前pom.xml配置

<build> <resources> <!--引入配置文件--> <resource><directory>src/main/resources</directory><filtering>false</filtering> </resource> <!--引入靜態文件--> <resource><directory>src/main/webapp</directory><targetPath>META-INF/resources</targetPath><filtering>false</filtering> </resource> </resources> <plugins> <plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> </build>

解決辦法:

1.高版本的插件不支持jsp,給spring-boot-maven-plugin指定版本號“1.4.2.RELEASE”

<build> <resources> <!--引入配置文件--> <resource><directory>src/main/resources</directory><filtering>false</filtering> </resource> <!--引入靜態文件--> <resource><directory>src/main/webapp</directory><targetPath>META-INF/resources</targetPath><filtering>false</filtering> </resource> </resources> <plugins> <plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId><version>1.4.2.RELEASE</version> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> </build>

2.根據spring官網說明,可打包war包,仍然可使用jar -jar xxx.war執行。

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-jsp-limitations

JSP LimitationsWhen running a Spring Boot application that uses an embedded servlet container (and is packaged as an executable archive), there are some limitations in the JSP support.With Jetty and Tomcat, it should work if you use war packaging. An executable war will work when launched with java -jar, and will also be deployable to any standard container. JSPs are not supported when using an executable jar.Undertow does not support JSPs.Creating a custom error.jsp page does not override the default view for error handling. Custom error pages should be used instead.

<packaging>war</packaging>

https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-documentation

spring官方不推薦使用jsp,推薦使用thymeleaf、freemaker、velocity等其他模塊引擎。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持好吧啦網。

標簽: Spring
相關文章:
主站蜘蛛池模板: 国产三级a三级三级三级 | 久久综合精品国产一区二区三区 | 草草视频在线播放 | 欧美激情一级欧美精品 | 国产精品成久久久久三级 | 福利姬在线精品观看 | 特级a欧美孕妇做爰片毛片 特级a欧美做爰片毛片 | 男女午夜免费视频 | 欧美成人三级视频 | 三级网站视频 | 国产精品91av | 毛片特黄| 国产高清精品一区 | 久久一区视频 | 一级成人毛片 | 亚洲欧美手机在线观看 | 中国美女一级黄色片 | 精品久久久久久亚洲 | 亚洲国产影院 | 国产younv真实 | 欧美性高清bbbbbbxxxxx | 怡红院在线视频全部观看 | 国产免费一区二区三区在线 | hd最新国产人妖ts视频 | 欧美一级一一特黄 | 7m视频精品凹凸在线播放 | 亚洲情a成黄在线观看动 | 国产精品久久久久a影院 | 日韩成人三级 | 视频一区二区在线 | 日韩精品一区二三区中文 | 国内自拍视频一区二区三区 | 交性视频免费看 | 国产成人精品系列在线观看 | 国产在线一区二区三区在线 | 免费高清特级毛片 | 另类视频区第一页 | 一本色道久久综合狠狠躁 | 国产精品国产亚洲精品看不卡 | 欧美日韩精品乱国产538 | 久久久国产在线 |