springboot整合JSP

引入jsp继承依赖

<dependency>
  <groupId>jstl</groupId>
  <artifactId>jstl</artifactId>
  <version>1.2</version>
</dependency>
<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>

2.配置视图解析器

  #在配置文件中引入视图解析器

#在配置文件中引入视图解析器
spring:
mvc:
 view:
  prefix: / 
  suffix: .jsp插件

 3.插件方式启动

<plugins>
  <plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
  </plugin>
</plugins>

 

posted @ 2020-12-22 14:50  大大大怪兽  阅读(85)  评论(0编辑  收藏  举报