I\'m experimenting on re-writing my configuration-heavy, vanilla Spring MVC project using Spring Boot. I started a brand new Spring Boot project in IntelliJ using the Spring
According to answer given by @Jasbin karki I tried and found placing your html or jsp files in main->webapp->views folder(you should create the webapp & views folders) and adding the following lines in application.properties file does the task. Add the following in application.properties:
spring.mvc.view.prefix=/views/
spring.mvc.view.suffix=.html //or .jsp- if its a jsp file
application.properties
Remove:
spring.mvc.view.prefix=/view/
spring.mvc.view.suffix=.jsp
Add:
spring.thymeleaf.prefix= /WEB-INF/views/
spring.thymeleaf.suffix= .html
pom.xml
Remove jasper dependency:
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>provided</scope>
</dependency>
Add thymeleaf dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Details: Using thymeleaf instead of jsp