在基于弹簧的项目中包含css与vaadin

尝试将简单的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'


慕尼黑5688855
浏览 119回答 1
1回答

子衿沉夜

修复了问题。我使用的是一个多模块maven项目,包含@SpringBootApplication并运行整个应用程序的main方法不在vaadin前端文件夹的同一模块中。解决方案是将主类移动到与用于vaadin的模块相同的maven模块。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java