[Springboot]打包成jar后,訪問不到jsp


/*=========================2019.12.19更新==============================*/

Springboot不建議使用JSP,所以會忽略JSP文件。

我改用了Thymeleaf,剛開始接觸,感覺和JSP相比更規范了。

看到網上說用這個,方便前端的人直接查看Thymeleaf模板(就是*.html)。

lol,繼續搬磚學習~

/*=============================原博客================================*/

1.打包成jar的過程中,沒有包含jsp文件。

可在pom.xml的<build>-<resources>下加入下面代碼。

<resource>
  <directory>src/main/webapp</directory>
  <targetPath>META-INF/resources</targetPath>
  <includes>
    <include>**/**</include>
  </includes>
</resource>

2.Springboot版本問題,原因暫時不清楚還請大佬們指點。

<plugin>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-maven-plugin</artifactId>
    <!--版本改為1.4.2-->
  <version>1.4.2.RELEASE</version>
</plugin>

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM