一种 WebMvcConfigurerAdapter 它已经过时了
我刚刚迁移 spring mvc 版本
, 但突然b。 eclipse STS WebMvcConfigurerAdapter 标记为过时
我怎样才能删除它!
5.0.1.RELEASE
, 但突然b。 eclipse STS WebMvcConfigurerAdapter 标记为过时
public class MvcConfig extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers/ResourceHandlerRegistry registry/ {
registry.addResourceHandler/"/resources/**"/.addResourceLocations/"/resources/"/;
// to serve static .html pages...
registry.addResourceHandler/"/static/**"/.addResourceLocations/"/resources/static/"/;
}
....
}
我怎样才能删除它!
没有找到相关结果
已邀请:
4 个回复
八刀丁二
赞同来自:
:
这是因为 Java 8 在涵盖类的功能的接口上输入了默认方法
看这里:
https://docs.spring.io/spring/ ... .html
小明明
赞同来自:
目前发现了 Spring 5.0.8 /目前开始了/ 界面
该课程已实施
, 我们可以直接扩展。
在这里,我如何使用它来配置我的资源处理机制如下。 -
石油百科
赞同来自:
从 Spring Boot 2.1.4.RELEASE /Spring Framework 5.1.6.RELEASE/ 这样做
詹大官人
赞同来自:
DispatcherServlet
. 通过避免静态文件请求 DispatcherServlet /Front contoller/, 我们是曲调
https://www.baeldung.com/sprin ... urces
.
Spring 3.1.
介绍 ResourceHandlerRegistry 用于设置 ResourceHttpRequestHandlers 维护静态资源 classpath, WAR 或文件系统。 我们可以定制 ResourceHandlerRegistry 我们的Web上下文配置类中的软件。
我们添加了模板
在 ResourceHandler, 给出资源
, 位于目录中
我们加了
模板
在 ResourceHandler, 还包括资源
, 位于目录中
配置 XML
https://docs.spring.io/spring- ... ntent
, 如果文件在该文件夹中 WAR
webapp/resources
.