Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

SpringBoot. One file catches CSS another doesn't

Having resource tree like this:
picture
File index.html sees the CSS, but file registration does not see it. Both located in one folder. Both have the same html definition:

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>All people</title>
    <link href="../../static/css/StyleCSS.css" th:href="@{css/StyleCSS.css}" rel="stylesheet" type="text/css" media="all" />
</head>

Files on github

What’s wrong with it?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

I know it is weird, but if you change

th:href="@{css/StyleCSS.css}"

to:

th:href="@{/css/StyleCSS.css}"

it is gonna work. Though I have no idea why it behaves differently on index.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading