I'm actually encountering a problem with my view, in fact I'm tryng to display a pdf or at least a download button. The problem is that I cannot access the "pdf" directory that I created. He is as the same level as my JS directory.
The path is src/main /resources/static/pdf. When I check on my devtools, the request to the pdf is 404 error. and I'm tryng to reach them with relative path.
Does anyone know how to solve this.
Here is my Security config :
@Configuration
@EnableWebSecurity
public class SecurityConfig {
@Bean
public BCryptPasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
/**
* Laisse le controle aux controllers
*/
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
return http.authorizeHttpRequests((auth) -> auth.anyRequest().permitAll()).build();
}
}
I suppose the file should be located under
src/main/resources/static/pdf. The 404 message indicates no security issue.http://localhost:8080/pdf/file123.pdfshould yield the correct file afterwards.