Как было сказано выше, файл должен находиться в $ClassPath/static/images/name.png
, (/ static или / public или / resources или / META-INF / resources). Этот класс $ ClassPath означает main/resources
или main/java
dir.
Если ваши файлы не находятся в стандартном каталоге, вы можете добавить следующую конфигурацию:
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/lib/**"); // like this
}
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
// ... etc.
}
...
}