Spring Boot是否可以使用JAR包装来提供JSP? [英] Is it possible with Spring Boot to serve up JSPs with a JAR packaging?

查看:71
本文介绍了Spring Boot是否可以使用JAR包装来提供JSP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我熟悉Spring Boot

I'm familiar with the Spring Boot JSP sample application

但是,该示例使用了WAR包装.可以用<packaging>JAR</packaging>做同样的事情吗?

However that example uses the WAR packaging. Is it possible to do the same with <packaging>JAR</packaging>?

我的目标是将JSP放在src/main/resources/jsp下,以简化我的应用程序的结构.

My goal is to put JSPs under src/main/resources/jsp to simplify the structure of my app.

推荐答案

正如@Andy Wilkinson所说,与JSP相关的局限性.请将您的应用程序打包为war并以jar执行.在春季现场有记录.

As @Andy Wilkinson said, there are limitations related to JSP. Please package your application as war and execute as jar. This is documented at spring site.

对于Tomcat,如果使用war打包,它应该可以工作,即可执行的war将可以工作(...). 由于Tomcat中采用了硬编码的文件模式,因此可执行jar无法正常工作.

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆