1,SessionConfiguration

package com.yuqiyu.jpf.config;

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.WebMvcConfigurerAdapter;
@Configuration
public class SessionConfiguration extends WebMvcConfigurerAdapter
{
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
       registry.addInterceptor(new SessionInterceptor()).addPathPatterns("/**").excludePathPatterns("/home/login.html"); //addPathPatterns l拦截  excludePathPatterns排除
        super.addInterceptors(registry);
    }
  /*  @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/home/*").addResourceLocations("classpath:/home/");

    }*/
}

你可能感兴趣的:(1,SessionConfiguration)