All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gitee.apanlh.spring.configure.WebConfiguration Maven / Gradle / Ivy

There is a newer version: 2.0.0.2
Show newest version
package com.gitee.apanlh.spring.configure;

import org.springframework.stereotype.Component;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.List;


/**
 * 	WebMVC配置
 * 	
 * 	@author Pan
 */
@Component
public class WebConfiguration implements WebMvcConfigurer {
	
	/**
	 * 	静态资源放行
	 * 	
添加静态资源访问({@code registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");}) * * @author Pan */ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { WebMvcConfigurer.super.addResourceHandlers(registry); } /** * 扫描自定义注解 * * @author Pan */ @Override public void addArgumentResolvers(List resolvers) { RequestParamConfiguration requestParamConfiguration = new RequestParamConfiguration(); requestParamConfiguration.addArgumentResolvers(resolvers); WebMvcConfigurer.super.addArgumentResolvers(resolvers); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy