SpringBoot要求我们把图片、css、js静态资源存放在resources/static目录中,而view层的模版放在resources/templates中。
这种情况访问http://127.0.0.1:8984/img/15.jpg,就能查看到这张图片
如果是直接存放在static目录里就这样访问http://127.0.0.1:8984/15.jpg
SpringBoot要求我们把图片、css、js静态资源存放在resources/static目录中,而view层的模版放在resources/templates中。
这种情况访问http://127.0.0.1:8984/img/15.jpg,就能查看到这张图片
如果是直接存放在static目录里就这样访问http://127.0.0.1:8984/15.jpg