registry.excludePathPatterns添加了html页面还是被拦截
时间: 2024-05-05 19:15:47 浏览: 11
可能是因为您的html页面被视为静态资源,而不是动态请求。在这种情况下,您需要使用registry.addResourceHandler添加一个资源处理程序来处理这些静态资源。例如:
```
registry.addResourceHandler("/**/*.html")
.addResourceLocations("classpath:/static/")
.setCachePeriod(3600)
.resourceChain(true)
.addResolver(new PathResourceResolver());
```
这样,所有以.html结尾的请求将被视为静态资源,并且不会被拦截。您可以将.addResourceLocations替换为您的html页面所在的目录。
相关推荐
![7z](https://img-home.csdnimg.cn/images/20210720083312.png)
![pol](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![m](https://img-home.csdnimg.cn/images/20210720083646.png)
![m](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)