总结.txt Springboot集成jsp步骤:1、在pom.xml中添加servlet-api,jstl,tomcat-embed-jasper依赖 javax.servlet javax.servlet-api provided jstl jstl 1.2 provided org.apache.tomcat.embed tomcat-embed-jasper provided 2、在applica
Springboot集成jsp 步骤: 1、在pom.xml中添加servlet-api,jstl,tomcat-embed-jasper依赖application.ymljavax.servlet javax.servlet-apiprovided jstl jstl1.2 provided 2、在application.yml中添加mvc配置 spring.mvc.view.prefix=/WEB-INF/jsp/ #页面默认前缀目录 spring.mvc.view.suffix=.jsp #页面默认后缀 3、在/WEB-INF/jsp/下新建controller返回的对应的jsp页面 问题:Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean. 原因:spring-boot-starter-tomcat下载包不完整 解决方案:删除后再update maven org.apache.tomcat.embed tomcat-embed-jasperprovided
spring: mvc: view: prefix: /WEB-INF/jsp/ #页面默认前缀目录 suffix: .jsp #页面默认后缀pom.xml
4.0.0 org.com.cay.spring-boot spring-boot-jsp0.0.1-SNAPSHOT war spring-boot-jsp Demo project for Spring Boot org.springframework.boot spring-boot-starter-parent1.5.6.RELEASE UTF-8 UTF-8 1.8 org.springframework.boot spring-boot-starter-weborg.springframework.boot spring-boot-starter-tomcatorg.springframework.boot spring-boot-starter-testtest javax.servlet javax.servlet-apiprovided jstl jstl1.2 provided org.apache.tomcat.embed tomcat-embed-jasperprovided org.springframework.boot spring-boot-maven-plugin