I've been stuck on this for a week or two now. For some reason no static resources will load. I chased down the "mime type" issue and discovered that's because it can't access/detect/something the static resources. Any help would be greatly appreciated!
Here is my file structure. My application.properties file has no adjustments to Thymeleaf or resources, so it should still be looking in the static folder.
I have removed all special SpringSecurity settings. My MvcConfig in very basic.
Here is my MvcConfig:
@Configuration
public class MvcConfig implements WebMvcConfigurer{
public void addViewcontrollers(ViewControllerRegistry registry) {
registry.addViewController("/login").setViewName("login");
registry.addViewController("/styledPages").setViewName("styledPages");
registry.addViewController("/").setViewName("login");
}
}
Here is my styledPages.html file (I stole this from a tutorial somewhere, just trying to get CSS to work in the project.):
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="https://www.thymeleaf.org" xmlns:sec="https://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
<meta charset="UTF-8">
<title>Add CSS and JS to Thymeleaf</title>
<link th:href="@{/css/main2.css}" rel="stylesheet" />
</head>
<body>
<h2>Carefully Styled Heading</h2>
<p>
This is text on which we want to apply <strong>very special</strong> styling.
</p>
</body>
</html>