问题描述
是这样子的,个人项目目录结构以下:
我在static目录下,建立了index.html和aaaa.jpg这两个文件。而后,启动服务访问 http://loclahost:8080/
能够正常访问
如今,有我建立test目录,添加这两个文件。目录以下:
如今,我重启服务,访问 http://localhost:8080/test/aaaa.jpg 出现404html
打开target目录以下
能够看到静态static下没有test目录。因此,404很正常。spring
解决办法,在pom文件添加build以下:springboot
删除,再添加文件,重启服务。页面能够访问了。ide
有问题,请留言!ui
我的博客地址: https://blog.ailijie.top/arch...idea