r/javahelp • • Nov 14 '19

Difference in using WEB-INF and resources folder

After reading this tutorial on Thymeleaf I found this one. First one uses some configurations to load templates from WEB-INF folder, second approach loads them from resources folder. What is the reasoning behind these approaches and what is the difference between them in web application context?

18 Upvotes

5 comments sorted by

3

u/rbobko70 Nov 15 '19

The only difference is only in how your project tree will look like. I feel like WEB-INF was used some time ago and now resources is the standard.

1

u/_fishysushi Nov 15 '19

so I should skip configuring the Thymeleaf resolver and just use the default resource/templates folder? Thanks for answering

1

u/rbobko70 Nov 15 '19

Exactly.

3

u/[deleted] Nov 15 '19

When you use external server like tomcat to deploy your application, you need to place thymeleaf templates in web-inf and when deploying your application with embedded tomcat that comes with spring boot, then you can place then under resources folder.

1

u/TotesMessenger Nov 15 '19

I'm a bot, bleep, bloop. Someone has linked to this thread from another place on reddit:

 If you follow any of the above links, please respect the rules of reddit and don't vote in the other threads. (Info / ^Contact)