玩转springboot之SpringBoot使用jsp

SpringBoot使用jsp

  • 需要添加jsp解析器依赖

        <!-- jsp -->
        <dependency>
           <groupId>org.apache.tomcat.embed</groupId>
           <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
    
  • 配置资源目录

        <!-- build标签中 -->
        <!-- jsp文件资源目录 -->
        <resources>
           <resource>
              <directory>src/main/webapp</directory>
              <targetPath>META-INF/resources</targetPath>
              <includes>
                 <include>**/*.*</include>
              </includes>
           </resource>
        </resources>
    
  • 注册视图解析器,前缀后缀

        spring:
          mvc:
            view:
              prefix: /
              suffix: .jsp
    

https://zhhll.icu/2022/框架/springboot/基础/18.springboot使用jsp/

相关推荐

  1. springbootSpringBoot使用jsp

    2024-07-16 03:36:02       18 阅读
  2. springbootxxxRunner接口使用

    2024-07-16 03:36:02       22 阅读
  3. springbootSpringApplicationRunListener

    2024-07-16 03:36:02       21 阅读
  4. springbootspringboot项目监测

    2024-07-16 03:36:02       24 阅读
  5. springbootSpringBoot单元测试

    2024-07-16 03:36:02       20 阅读
  6. springbootspringboot启动原理

    2024-07-16 03:36:02       19 阅读
  7. springbootspringboot使用外置tomcat进行运行

    2024-07-16 03:36:02       20 阅读
  8. springbootspringboot定制化tomcat

    2024-07-16 03:36:02       28 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-16 03:36:02       52 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-16 03:36:02       54 阅读
  3. 在Django里面运行非项目文件

    2024-07-16 03:36:02       45 阅读
  4. Python语言-面向对象

    2024-07-16 03:36:02       55 阅读

热门阅读

  1. 神经网络调参技巧(入门案例教程)

    2024-07-16 03:36:02       16 阅读
  2. 双缓存机制

    2024-07-16 03:36:02       14 阅读
  3. CNN -1 神经网络-概述

    2024-07-16 03:36:02       16 阅读
  4. 输入两个整数,输出最大公约数与最小公倍数。

    2024-07-16 03:36:02       15 阅读
  5. linux压缩/解压缩命令

    2024-07-16 03:36:02       17 阅读
  6. python pandas处理股票量化数据:笔记4

    2024-07-16 03:36:02       15 阅读
  7. Vue3中的ref函数

    2024-07-16 03:36:02       17 阅读