以下是一个简单的Spring Boot示例,展示如何配置Spring以不拦截jsp页面:

```java

spring 不拦截jsp页面实例,如何在Spring中确保jsp页面不被拦截  第1张

import org.springframework.context.annotation.Configuration;

import org.springframework.web.servlet.config.annotation.InterceptorRegistry;

import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration

public class WebConfig implements WebMvcConfigurer {

@Override

public void addInterceptors(InterceptorRegistry registry) {

// 配置拦截器

registry.addInterceptor(new MyInterceptor())

.excludePathPatterns("