[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