zoukankan      html  css  js  c++  java
  • SpringBoot整合JSP

    一、目录展示

      

     二、导入依赖

        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    <!-- Spring-boot-devtools -->
        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-devtools</artifactId>
          <optional>true</optional>
        </dependency>
        <!-- 配置servlet需要的依赖  -->
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>javax.servlet-api</artifactId>
        </dependency>
        <!-- 配置jstl标签库需要的依赖  -->
        <dependency>
          <groupId>javax.servlet</groupId>
          <artifactId>jstl</artifactId>
        </dependency>
    
        <!-- 添加tomcat的支持 -->
        <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>
    View Code

    三、application.yml配置文件

      

     四、JSPController

      

     五、index.jsp页面

       

     六、测试类StartJSP

      

     七、效果展示

      

     八、注意

      如果项目为父子工程,测试类默认找父类jsp页面测试,因此需要指定子项目的访问路径

    步骤:

      

      

      

      

  • 相关阅读:
    FPGA市场潜力有几多?
    FPGA前世今生(四)
    FPGA前世今生(三)
    FPGA前世今生(二)
    FPGA前世今生(一)
    嵌入式视频处理考虑(二)
    常用Linux操作命令
    混合开发学习路线
    Eclipse使用
    ECS的配置与使用
  • 原文地址:https://www.cnblogs.com/Zzzzn/p/12029627.html
Copyright © 2011-2022 走看看