Spring Boot Integrated JSP
Steps:
1. Create a new spring boot project
2. Modifying the Pom file
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
</dependency>
These dependencies must be remembered Plus!!!
3. Create a new directory structure
Look carefully, in order to let the WebApp file icon has a small dot ~ ~ So the point is, we have to set up
Also, there is a spring configuration in the red box, delete it.
4. Configure the path
Application.properties file
Spring.mvc.view.prefix/
Spring.mvc.view.suffix. JSP
5. Write a controller and JSP test bar, it should be no problem, if not, remember to change the Pom file to packaging method to war,
6. Summary
Spring boot is not recommended JSP, or use thymeleaf template bar, or very useful. On this issue has been delayed for most of the day, the final is a vague out, the efficiency is really low. Next step, build a spring boot crud.
Spring boot integration of those pits of JSP (Spring Boot learning Note III)