@Configuration
public class WebMvcConfiguration
extends java.lang.Object
implements org.springframework.web.servlet.config.annotation.WebMvcConfigurer
构造器和说明 |
---|
WebMvcConfiguration() |
限定符和类型 | 方法和说明 |
---|---|
void |
addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
静态资源的配置 - 使得可以从磁盘中读取 Html、图片、视频、音频等
|
void |
addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
方案一: 默认访问根路径跳转 doc.html页面 (swagger文档页面)
方案二: 访问根路径改成跳转 index.html页面 (简化部署方案: 可以把前端打包直接放到项目的 webapp,上面的配置)
|
void |
configureMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
添加Long转json精度丢失是配置
|
org.springframework.web.filter.CorsFilter |
corsFilter() |
org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository |
getInMemoryHttpTrace()
SpringBootAdmin的Httptrace不见了
https://blog.csdn.net/u013810234/article/details/110097201
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addArgumentResolvers, addCorsMappings, addFormatters, addInterceptors, addReturnValueHandlers, configureAsyncSupport, configureContentNegotiation, configureDefaultServletHandling, configureHandlerExceptionResolvers, configurePathMatch, configureViewResolvers, extendHandlerExceptionResolvers, extendMessageConverters, getMessageCodesResolver, getValidator
public void addResourceHandlers(org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry registry)
addResourceHandlers
在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer
public void addViewControllers(org.springframework.web.servlet.config.annotation.ViewControllerRegistry registry)
addViewControllers
在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Bean @Conditional(value=CorsFilterCondition.class) public org.springframework.web.filter.CorsFilter corsFilter()
public void configureMessageConverters(java.util.List<org.springframework.http.converter.HttpMessageConverter<?>> converters)
configureMessageConverters
在接口中 org.springframework.web.servlet.config.annotation.WebMvcConfigurer
@Bean public org.springframework.boot.actuate.trace.http.InMemoryHttpTraceRepository getInMemoryHttpTrace()