Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 异常请求方法';把';不支持_Spring_Spring Boot_Spring Mvc_Spring Security - Fatal编程技术网

Spring 异常请求方法';把';不支持

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(

我有一个基于角色系统的spring项目。当我向受保护的资源发送put请求并出现访问被拒绝异常时,我希望重定向到html页面,但我有异常
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技术?