在带有spring-boot的vaadin项目中使用spring security时遇到问题。因此,我正在使用PdfViewer插件来显示PDF文件。但是我收到以下错误消息:
error:"Not Found"
message:"No message available"
path:"/APP/PUBLISHED/pdf.worker.js"
status:404
Run Code Online (Sandbox Code Playgroud)
我的春季安全配置如下所示:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.headers()
.defaultsDisabled()
.frameOptions().sameOrigin().and()
.csrf().disable() // Use Vaadin's CSRF protection
.authorizeRequests().antMatchers("/").permitAll()
.antMatchers("/vaadinServlet/HEARTBEAT/**").permitAll()
.antMatchers("/vaadinServlet/UIDL/**").permitAll()
.antMatchers("/vaadinServlet/APP/PUBLISHED/**").permitAll()
.antMatchers("login?debug").permitAll()
.antMatchers("/#!pwdreset/*").permitAll()
.antMatchers("/pwdreset/*").permitAll()
.and()
.authorizeRequests()
.and()
.formLogin().loginPage("/#!login").permitAll()
.and()
.logout().logoutUrl("/#!login?logout").logoutSuccessUrl("/").permitAll().and()
.sessionManagement().sessionFixation().newSession();
}
@Override
public void configure(WebSecurity web) throws Exception {
web.ignoring().antMatchers("/resources/**", "/VAADIN/**");
}
Run Code Online (Sandbox Code Playgroud)
因此,在Chrome浏览器中检查了已加载的文件,我看到了/ vaadinServlet / APP / PUBLISHED /文件夹,其中包含所有需要的文件。
在不使用Spring Security的情况下使用Addon可以正常工作,所以有人有想法吗?
更新资料
它似乎与Spring安全性无关,因为我在一个新的简单项目中测试Addon时得到了类似的行为。弹簧靴似乎是个问题。
要重现此问题,您需要(要下载的完整项目):
/webapp/fileserror:"Not Found"
message:"No …Run Code Online (Sandbox Code Playgroud)