小编Red*_*ato的帖子

使用vaadin的Spring Boot时的404 for js文件

在带有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时得到了类似的行为。弹簧靴似乎是个问题。

要重现此问题,您需要(要下载的完整项目):

  • 基本的春季启动+ vaadin应用程序框架
  • 简单的PDF及以下 /webapp/files
  • 在pom和widgetset中编译的PdfViewer加载项
  • 下面的简单UI
error:"Not Found"
message:"No …
Run Code Online (Sandbox Code Playgroud)

java spring spring-security vaadin spring-boot

4
推荐指数
1
解决办法
682
查看次数

标签 统计

java ×1

spring ×1

spring-boot ×1

spring-security ×1

vaadin ×1