I've found samples that stores static files in /src/main/webapp/
and /src/main/resources/static/
. What's the difference and what's the best place to store static files in spring-boot
app?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
If your resources are in src/main/webapp
that suggests you are building a WAR archive. And for a JAR src/main/resources
is more appropriate (eg in /static
if it's a boot app). It's up to you though if you want to put stuff in non standard places - you just have to configure the build system to understand what you mean.