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

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

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

瀏覽:92日期: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
相關文章:
主站蜘蛛池模板: 91情国产l精品国产亚洲区 | 久草中文在线视频 | 欧美一级毛片特黄黄 | 久久久久久久久免费影院 | 老司机黄色影院 | 日韩中文字幕在线观看视频 | 中文字幕精品一区二区三区视频 | 国产va免费精品高清在线观看 | 9999毛片免费看 | 色综合久久一本首久久 | 国产精品v欧美精品v日本精 | 日韩一区二区在线观看 | 国产成人午夜性a一级毛片 国产成人午夜性视频影院 国产成人香蕉久久久久 | 国产色视频一区二区三区 | 成人高清毛片a | 国产片一级片 | 欧美成人精品一区二区 | 99精品视频一区在线视频免费观看 | 国产三级网站在线观看 | 国产精品久久久久久久人热 | 国产在线观a免费观看 | 亚洲专区在线 | 国产午夜精品理论片久久影视 | 国产dvd毛片在线视频 | 一区二区三区国产精品 | 久久99毛片免费观看不卡 | 久久国产精品二国产精品 | 99久久综合狠狠综合久久一区 | 99久女女精品视频在线观看 | 末成年娇小性色xxxxx | 亚洲国产一区二区三区在线观看 | 欧美特级视频 | 国产精品九九视频 | 欧美一区二区三区不卡免费观看 | 国产欧美亚洲精品a | 亚洲国产一区在线 | 欧美美女视频网站 | 在线亚州| 老头老太做爰xxx视频 | 996久久国产精品线观看 | 日韩特级片 |