Where place static css file in a spring-boot project -


in current spring-boot project, views have line:

<link href="signin.css" rel="stylesheet"/> 

to reference static css file. when run project, , access 1 of views reference file, 404 not found error or 403 unauthorized error, depending put file inside project.

i try far:

src/main/resources/static/css (with this, use css/signin.css instead of signin.css)  src/main/resources/templates/static/css (with this, use css/signin.css instead of signin.css)  src/src/main/resources/templates/acesso (same folder of html file) 

what right place store type of files?

anywhere beneath src/main/resources/static appropriate place static content such css, javascript, , images. static directory served /. example, src/main/resources/static/signin.css served /signin.css whereas src/main/resources/static/css/signin.css served /css/signin.css.

the src/main/resources/templates folder intended view templates turned html templating engine such thymeleaf, freemarker, or velocity, etc. shouldn't place static content in directory.

also make sure haven't used @enablewebmvc in application disable spring boot's auto-configuration of spring mvc.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -