2
votes

I'm looking for solution how to create with gradle executable JAR from Spring Boot application with JSPs. I found the solution with maven https://dzone.com/articles/spring-boot-with-jsps-in-executable-jars-1

Main idea is to put JSPs to src/main/resources/META-INF/resources/WEB-INF/jsp/. And it works with maven, but not with gradle.

Thanks

1

1 Answers

1
votes

1) add to standard spring-boot dependencies:

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

2) put JSPs to src/main/webapp/WEB-INF/jsp

3) change application.properties

spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp

Here is the example repo: https://github.com/markstein/Labor/tree/master/spring/labor-spring-boot