私はJEEプロジェクトで、Spring Bootフレームワークを使用しています。 認証のために、私はSpring Securityを使用し、テンプレート内のページを指定しました。 localhost:8080/INDEX.HTML
またはI 2つの文字localhost/index.httml
を追加し、ページがauthantificationなしで表示さん:URLに大文字のスプリングセキュリティマッピング
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/login").permitAll()
.antMatchers("/token", "/index", "/index.html", "/main", "/main.html", "/main2", "/main2.html", "/recent1", "/recent1.html", "/recent2", "/recent2.html").hasRole("USER");
http
.csrf()
.disable()
.formLogin()
.loginPage("/login")
.failureUrl("/login?error=true")
.defaultSuccessUrl("/index");
http
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/login");
}
問題は、私は、アプリケーションを実行し、私のような大文字とURLを書いたとき、ということです。
このソリューションの.antMatchers( "/ login"、 "/ LOGIN")を使用できます。もう一つはこのようなものです。 –