1

Can you please help me with an issue I have with loading static resources? I tried the official Spring Security tutorial as well as trying to find up-to-date information on the Internet. Nothing seems to work. I can't access static resources from any folder in my Demo Spring App.

Here's a link to the DemoApp repo - https://github.com/StanislavStanev/SpringMVCDemoApp

In the main folder of the Repo is a presentation that I used as a guide, on how to configure the damn thing - (file name)10. Java-MVC-Frameworks-Filters-and-User-Authentication

Here's links, where I tried to find a solution to my problem: https://docs.spring.io/spring-security/site/docs/5.3.0.M1/reference/htmlsingle/#mvc-requestmatcher

https://docs.spring.io/spring/docs/5.0.0.RELEASE/spring-framework-reference/web.html#mvc-config-static-resources

Spring Security Thymleaf static resources don't load

Serving static web resources in Spring Boot & Spring Security application

https://www.baeldung.com/security-none-filters-none-access-permitAll

This is a screenshot of the Network tab in my browser, saying that I'm able to find a resources, but need to be redirected, etc. I tried putting the same resource in different folders, toying with different configurations on different classes.

browser-network-tab

If you need more information, please let me know. I really need to figure this out. Thank you in advance.

  • Please avoid posting links to repositories that include your entire project and try to include all the relevant code in your post. – Nikos Hidalgo Jan 15 '20 at 12:52
  • Thank you, Nikos. This makes perfect sense and I realize, that my post isn't perfect. However, this is a test project. There's nothing sensitive there. What I really hope for, is that someone who has built Spring Security will see this and tell me, what I'm doing wrong. – Itsadamnshame Jan 15 '20 at 13:10
  • I hope someone can help too! Personally I don't know anything about it, I just thought, seeing that you're new here, I could warn you in case no one replies here, that you shouldn't feel disheartened. Just edit your question and try again! – Nikos Hidalgo Jan 15 '20 at 14:09
  • Try changing css reference in your html file as - – S B Jan 15 '20 at 15:01
  • Thank you, to all who took of their time to look at my question. I solved it, by re-applying the steps in the manual I posted above. For some reason, this time it worked. It finds css and js files from the initial resources folder, under /css and /js. – Itsadamnshame Jan 15 '20 at 15:12

0 Answers0