亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

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

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

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

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

問題如下

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

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

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

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: 亚洲在线看片 | 日韩 欧美 中文字幕 不卡 | 欧美第一页草草影院 | 爱爱动态视频免费 | av香港经典三级级 在线 | 欧美三区在线观看 | 特级做人爱c级特级aav毛片 | 亚洲a级毛片 | 亚洲综合伊人色一区 | 欧美日韩亚洲另类人人澡 | 免费成人 | 亚洲视频在线观看网址 | 日本tv欧美tv天堂 | 亚洲一级毛片欧美一级说乱 | 特黄aaaaaaaaa及毛片 | 欧美伊人久久 | 精品视频手机在线观看免费 | 亚洲精品在线播放视频 | 日韩视频一 | 一区在线视频 | 一区二区三区不卡免费视频97 | 中文字幕在亚洲第一在线 | 波多野吉衣一区二区三区四区 | 香港一级a毛片在线播放 | 中文字幕日韩精品中文区 | 亚洲国产激情在线一区 | 日本色图在线 | 不卡的毛片 | 欧美国产成人精品一区二区三区 | 国产自一区 | 在线免费观看黄色网址 | 午夜成年| 性夜黄 a 爽免费看 性性影院在线观看 | 国产亚洲婷婷香蕉久久精品 | 日本老年人精品久久中文字幕 | 免费欧美在线视频 | 亚洲短视频在线观看 | 美国一级毛片片aa久久综合 | 欧美一级在线视频 | 伊人久久综合影院 | 久久综合给合久久狠狠狠97色69 |