in my Spring Boot app I switched from Thymeleaf to JSP and it is working normally on my local computer, but when I upload it to Heroku server I getThere was an unexpected error (type=Not Found, status=404).
/WEB-INF/jsp/home.jsp
its jar packaged, what does it mean if its working locally but not on Heroku server?
edit, project structure
Try adding this to pom.xml
:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
and adding this to application.properties
:
spring.mvc.view.prefix=/WEB-INF/jsp/
spring.mvc.view.suffix=.jsp
and moving JSPs to src/main/webapp/WEB-INF/jsp
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With