尝试将简单的css文件包含在vaadin路由中使用spring boot并拥有一个maven项目。当我在客户端加载页面时,我得到这个错误:Refused to apply style from 'http://localhost:8080/frontend/css/msas_login_page.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.当我尝试访问上面的网址时,我被重定向到这个html错误页面Could not navigate to 'css/msas_login_page.css'Reason: Couldn't find route for 'css/msas_login_page.css'
1 回答

子衿沉夜
TA贡献1828条经验 获得超3个赞
修复了问题。
我使用的是一个多模块maven项目,包含@SpringBootApplication并运行整个应用程序的main方法不在vaadin前端文件夹的同一模块中。
解决方案是将主类移动到与用于vaadin的模块相同的maven模块。
添加回答
举报
0/150
提交
取消