Below, I am using login.html as the page where I am adding the image test.png
within /static/images/
So, in login.html, I have <img src="../static/images/test.png" width="1000" th:src="@{images/test.png}"/>
, which gives a blank image. Why isn't it showing up?
In my SecurityConfiguration.java
file, I have
@Override
protected void configure(final HttpSecurity http) throws Exception {
http
.csrf().disable()
.authorizeRequests()
//.antMatchers("/**").hasRole("ADMIN")
.antMatchers("/static").permitAll()
.and().formLogin()
.loginPage("/login")
.permitAll();
When I use this configuration, it uses the default index.html page which shows the image fine. But, If I uncomment .antMatchers("/**").hasRole("ADMIN")
, it will bring me to login.html, but I can't view the image.