1,SessionConfiguration
作者:
滔滔逐浪 | 来源:发表于
2019-01-11 14:43 被阅读1次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
本文链接:https://www.haomeiwen.com/subject/yusxdqtx.html
网友评论