av一区二区在线观看_亚洲男人的天堂网站_日韩亚洲视频_在线成人免费_欧美日韩精品免费观看视频_久草视

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

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

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

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

問題如下

Spring打包jar包時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指定版本號“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)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Spring
相關(guān)文章:
主站蜘蛛池模板: www操操| 91精品国产91久久久久久吃药 | 亚洲综合视频 | av一区二区在线观看 | www国产成人免费观看视频,深夜成人网 | 网色 | 久久九九色 | 春色av| 欧美一区二区大片 | 欧美一级一区 | 国产成人精品在线播放 | 天天干天天爱天天 | 中文字幕av中文字幕 | 欧美大片黄| 在线一区 | 国产一区二区三区在线免费 | 久久精品91久久久久久再现 | 免费视频久久久久 | 久久精品久久久久久 | 激情91 | 一二三四av| 99riav3国产精品视频 | 欧美视频在线观看 | 99久视频| 日韩aⅴ视频 | 欧美日韩国产在线观看 | 极品一区 | 国产精品久久久久久久久免费高清 | 99久久久99久久国产片鸭王 | 天堂一区二区三区 | 草久久 | 国产偷久久一级精品60部 | 99精品视频在线观看免费播放 | 国产精品久久a | 91观看| 亚洲色图第一页 | 国产精品视频久久 | 久久毛片| 欧美一区二区三区在线看 | 户外露出一区二区三区 | 亚洲一二三在线观看 |