SpringBoot整合SpringMVC

时间:2024-6-10    作者:老大夫    分类: SSM


controller就正常加注解使用

application配置通常在server包下

静态资源都放在resources/static 目录下,非静态资源目录无法直接访问得到,也可以手动配置,配置后默认的自动被覆盖失效
外部访问静态资源时,不需要把static的静态文件目录加上

spring:
  web:
    resources:
      static-locations: classpath:/newstatic

拦截器使用

  1. 新建拦截器

  1. 编写配置类


扫描二维码,在手机上阅读

推荐阅读: