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

您的位置:首頁技術(shù)文章
文章詳情頁

Spring打包jar包時(shí)jsp頁面無法訪問問題解決

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

spring打包jar包時(shí)jsp頁面無法訪問

問題如下

Spring打包jar包時(shí)jsp頁面無法訪問問題解決

當(dāng)前pom.xml配置

<build> <resources> <!--引入配置文件--> <resource><directory>src/main/resources</directory><filtering>false</filtering> </resource> <!--引入靜態(tài)文件--> <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指定版本號(hào)“1.4.2.RELEASE”

<build> <resources> <!--引入配置文件--> <resource><directory>src/main/resources</directory><filtering>false</filtering> </resource> <!--引入靜態(tài)文件--> <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.根據(jù)spring官網(wǎng)說明,可打包war包,仍然可使用jar -jar xxx.war執(zhí)行。

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等其他模塊引擎。

以上就是本文的全部內(nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 91高端极品外围在线观看 | 久久综合精品国产一区二区三区无 | 欧美一级毛片日本 | 99精品视频在线这里只有 | 新26uuu在线亚洲欧美 | 伊人色综合7777 | 成人亚洲在线观看 | 九九综合九九 | 亚洲国产精品久久久天堂 | 国产成人综合日韩精品无 | 国产精品久久免费观看 | 台湾精品视频在线播放 | 欧美 亚洲 另类 自拍 在线 | 91玖玖| 美女一级毛片毛片在线播放 | 久9视频这里只有精品 | 免费一级特黄3大片视频 | 毛片免费观看的视频在线 | 中文字幕最新中文字幕中文字幕 | 国产欧美精品一区二区 | 精品理论片一区二区三区 | 天天摸天天爽视频69视频 | 欧美极品在线视频 | 国产精品7m凸凹视频分类大全 | 国产精品理论片 | 美女张开腿给男生桶下面视频 | 亚洲欧美日韩久久一区 | 欧美激情免费观看一区 | 毛片免费高清免费 | 欧美性另类69xxxx极品 | 亚洲精品国产一区二区三 | 国产高清免费不卡观看 | 欧美成人黄色网 | 欧美国产伦久久久久 | 亚洲精品高清国产一线久久97 | 手机看片久久高清国产日韩 | 91av观看| 久久一本精品久久精品66 | 久久精品三级视频 | 欧美视频二区 | 日韩精品999 |