Spring-Boot Not Finding JSP Pages in WAR File Spring-Boot Not Finding JSP Pages in WAR File spring spring

Spring-Boot Not Finding JSP Pages in WAR File


I had the same issue and in my case it happened because I was missing a library in the classpath.

Spring Boot does not include Jasper as default and therefore JSP rendering doesn't work unless you explicitly include the library:

For Gradle:

compile("org.apache.tomcat.embed:tomcat-embed-jasper")

For Maven:

<dependency>    <groupId>org.apache.tomcat.embed</groupId>    <artifactId>tomcat-embed-jasper</artifactId>    <scope>provided</scope></dependency>


I don't think JSPs in executable archives are fully supported yet in Spring Boot (it's on the list), so I would try and make it work first with a) a deployed WAR, and/or b) an exploded archive (or running from the IDE), or running from source. Once that is working you might still have to wait for the full JSP support to be added (contributions welcome), but at least you will know that it works. The error you are seeing in the deployed WAR (no mapping) suggests that there is something else going on. Note that there is a JSP sample in Spring Boot if you want something to compare - works up to a point (the JSP is resolved and rendered).

Edit: Spring taglibs, JSTL and EL support seem to be working in the sample above. I just updated it to add JSTL and tested from IDE and as an executable WAR.


I was having a similar problem, caused by the default servlet not being mapped. I had to do this in my extends DelegatingWebMvcConfiguration class:

@Overrideprotected void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {    configurer.enable();}