国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

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

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

瀏覽:85日期: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
相關文章:
主站蜘蛛池模板: 草草影院私人免费入口 | 尹人在线视频 | 日本b站一卡二卡乱码入口 日本s色大片在线观看 | 99久久精品免费视频 | 成年人网站黄 | 18videosex性欧美69超高清 | 久久爱青青草 | 亚洲精品视频在线 | 一区毛片 | 成人国产亚洲欧美成人综合网 | www.成人网 | 91香蕉网| 久久香蕉精品成人 | 欧美日韩精品在线视频 | www.99在线观看 | 亚洲欧美国产一区二区三区 | 亚洲香蕉一区二区三区在线观看 | 国产成人亚洲合集青青草原精品 | 91热久久免费频精品动漫99 | 亚洲视频在线免费 | 国产一区二区三区精品视频 | 日韩a级 | 国产成人一区二区视频在线观看 | 一级毛片免费不卡在线视频 | 在线观看 国产 | 欧美一区永久视频免费观看 | 国产精品久久久久久久久免费 | 久艹视频在线 | 日本www高清免费视频观看 | 国产成人黄网址在线视频 | 日韩一级在线 | 久久综合狠狠综合狠狠 | 性xxxx奶大欧美高清 | 亚洲成人第一页 | 欧美一级专区免费大片 | 在线免费观看一级毛片 | 久久网站免费观看 | 亚洲日本久久一区二区va | 一级毛片成人免费看免费不卡 | 久久久久综合国产 | 手机在线毛片免费播放 |