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

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

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

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

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

問(wèn)題如下

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

當(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)說(shuō)明,可打包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)文章:
主站蜘蛛池模板: 曰批美女免费视频播放 | 台湾三级| 国产深夜福利在线观看网站 | 女人张开腿让男人桶视频免费大全 | 99热免费在线 | 97国产成人精品免费视频 | 日韩www视频 | 美女一级毛片免费不卡视频 | 一区二区三区在线免费看 | 韩国美女爽快一毛片免费 | 欧美高清日韩 | 69欧美| 久久久久久久久久久大尺度免费视频 | 欧美亚洲国产成人高清在线 | 国产亚洲精品aaa大片 | 欧美一区二区在线播放 | 成人国产在线24小时播放视频 | 亚洲国产日产韩国欧美综合 | 国产成人av性色在线影院 | 亚洲精品视频免费在线观看 | 一级a毛片免费 | 成人区精品一区二区不卡亚洲 | 亚洲欧美男人天堂 | 亚洲依依成人综合在线网址 | 毛片在线看免费 | 亚洲九九视频 | 日本天堂视频在线观看 | 狠狠综合久久久综合 | 欧美精品99久久久久久人 | 国产激情久久久久影 | 美女黄视频网站 | 国产不卡影院 | 国产短裙黑色丝袜在线观看下 | 亚洲国产精品aaa一区 | 日本s色大片在线观看 | 亚洲日本欧美产综合在线 | 欧美又粗又硬又大久久久 | 欧美理论片在线观看一区二区 | 女人张开双腿让男人桶爽免 | 一级黄色美女视频 | 久草免费新视频 |