在我当前的spring-boot项目中,我的观点如下:
<link href="signin.css" rel="stylesheet"/>
引用静态CSS文件。运行项目并访问引用此文件的视图之一时,会收到404 not found错误或403未经授权的错误,具体取决于我将文件放在项目中的位置。
到目前为止,我尝试了以下方法:
src/main/resources/static/css (with this, I use css/signin.css instead of signin.css)
src/main/resources/templates/static/css (with this, I use css/signin.css instead of signin.css)
src/src/main/resources/templates/acesso (same folder of the html file)
什么类型的文件存储在正确的位置?