可能的原因: (1)你url地址写错了 (2)你springsecurity中配置的url没有写"/",如 .antMatchers("fileUpload","index").hasAnyRole("OPERATOR","ADMIN") 正确的写法应该是: .antMatchers("/fileUpload","/index").hasAnyRole("OPERATOR","ADMIN")