Spring boot can not find jsp views

后端 未结 3 631
攒了一身酷
攒了一身酷 2020-12-18 03:42

Helo everyone! I completed my Spring based web app and then started to rebuild it to Spring boot because it gives me ability to use

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-18 04:31

    JSPs in executable JARs are not officially supported by Spring Boot, this is one of the known JSP limitations. Also, Spring Boot supports JSPs in embedded Jetty as of 1.4.0.RC1, not before.

    Right now you can solve this by using Spring Boot 1.4+ and packaging your application as an executable WAR. You'll be able to deploy your app as a regular WAR, run it with java -jar app.war and have a nice development experience - all of this with standard JSPs.

    Maybe you'll find tricks to work around those limitations, but keep in mind that those often rely on container-specific behavior that aren't supported by the servlet spec. So at best, this behavior will be inconsistent between containers - and it's certainly possible that containers may change their behavior at any time.

    If you really want to package your app as an executable JAR, then the best approach is not to use JSPs and pick a proper template engine.

提交回复
热议问题