Spring Boot JSP 404

后端 未结 14 1469
陌清茗
陌清茗 2020-11-28 07:17

I\'m trying to add a jsp page in my Spring Boot service. My problem is that every time I try to go to that page I have this:

Whitelabel Error Page

14条回答
  •  暖寄归人
    2020-11-28 07:20

    To have this in pom.xml

    
    
        org.apache.tomcat.embed
        tomcat-embed-jasper
        provided
    
    
    
        javax.servlet
        jstl
    
    

    It may be not enough.

    You must not miss this.

    war
    

    Otherwise when you build the package, you will get as a jar file and that does not have JSP nor the embedded tomcat.

    See runable example and its explanation here https://www.surasint.com/spring-boot-jsp/

提交回复
热议问题