No CSS is applied to the webpage on IntelliJ Ultimate.

Answered

Hello, community.

I am using IntelliJ-Ultimate and it's a Spring MVC project with the thymeleaf template engine.

In the project there's a login page (i.e login.html) in the file I have clearly specified the path to the stylesheets, yet while running the CSS isn't applied.I have also used "th:href = "@{/static/login.css}"

Also to mention, that I have my .html files in src/..../resources and my stylesheets in src/..../resources/static.

I also have disabled tymeleaf caching in the application.properties.

How should I proceed? Please tell me if you require screenshot of any files.

Thank you.

0
5 comments

Does it work correctly if you build/run this project outside of IntelliJ IDEA, via Gradle or Maven?

0
Avatar
Permanently deleted user

Hey didn't tried that before and yeah doesn't work with that too. So it's not a prob with IntelliJ-U

0

It means that the issue is not specific to IntelliJ IDEA, it's either a problem with your code, a configuration issue or some framework bug. You can ask this question at https://stackoverflow.com/.

0
Avatar
Permanently deleted user

Thanks, Serge Baranov. Actually, this error occurred because I didn't have my Spring Boot project configured for resource handlers (Beginner's mistake). For people with the same problem, https://www.baeldung.com/spring-mvc-static-resources here is a helpful link.

3

Please sign in to leave a comment.