Spring boot can not find jsp views

后端 未结 3 628
攒了一身酷
攒了一身酷 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:42

    If you want to do a jar-Deployment you cannot use the wepapp folder.

    1. Put your JSPs to src/main/resources/META-INF/resources/jsp
    2. Put these lines to your application.properties file:

      spring.mvc.view.prefix=/jsp/
      spring.mvc.view.suffix=.jsp
      

    You can have a look to this project. It also uses Spring-Boot, a jar-Deployment and JSPs: https://github.com/synyx/urlaubsverwaltung

提交回复
热议问题