Spring 异常请求方法';把';不支持
我有一个基于角色系统的spring项目。当我向受保护的资源发送put请求并出现访问被拒绝异常时,我希望重定向到html页面,但我有异常Spring 异常请求方法';把';不支持,spring,spring-boot,spring-mvc,spring-security,Spring,Spring Boot,Spring Mvc,Spring Security,我有一个基于角色系统的spring项目。当我向受保护的资源发送put请求并出现访问被拒绝异常时,我希望重定向到html页面,但我有异常org.springframework.web.HttpRequestMethodNotSupportedException:不支持请求方法“put” 我的spring配置,csrf已禁用 private void commonConfigure(HttpSecurity http) throws Exception { setupCsrfFilter(
org.springframework.web.HttpRequestMethodNotSupportedException:不支持请求方法“put”
我的spring配置,csrf已禁用
private void commonConfigure(HttpSecurity http) throws Exception {
setupCsrfFilter(http);
http.authorizeRequests().accessDecisionManager(accessDecisionManager())
.antMatchers("/**").hasAnyAuthority(ADMIN)
.and().httpBasic()
.and().jee().j2eePreAuthenticatedProcessingFilter(j2eePreAuthenticatedProcessingFilter())
.mappableAuthorities(ADMIN)
.and().exceptionHandling().accessDeniedPage("/unauthorized.html")
.and().headers().contentTypeOptions()
.and().xssProtection()
.and().frameOptions()
.and().httpStrictTransportSecurity()
.and().contentSecurityPolicy(CONTENT_SECURITY_POLICY);
}
您的控制器中是否有
PUT
请求映射方法?是的,我有,如果我以管理员角色登录,一切正常@κццццццц问题是:您的/unauthorized.html能否处理PUT请求/unauthorized.html这是静态html页面这是一个web应用程序吗?还是RESTAPI?如果是web应用,您使用的是哪种UI技术?