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

cn.tenfell.tools.nocontroller.config.NoControllerConfiguration Maven / Gradle / Ivy

The newest version!
package cn.tenfell.tools.nocontroller.config;

import cn.tenfell.tools.nocontroller.filter.LoginHandlerInterceptor;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import java.util.ArrayList;
import java.util.List;

@Configuration
@ComponentScan(basePackages="cn.tenfell.tools.nocontroller"+"*..*")
public class NoControllerConfiguration implements WebMvcConfigurer {
    public static String key;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        List list = new ArrayList();
        list.add("/**/*.*");
        registry.addInterceptor(new LoginHandlerInterceptor()).excludePathPatterns(list);
    }
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/**").addResourceLocations("classpath:/static/");
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy