在STS添加static目录后,可以正常访问,但在idea下,却无法访问。
image.png解决办法:在build下添加resources如下内容
<build>
<plugins>
...
</plugins>
<resources>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.*</include>
</includes>
</resource>
</resources>
</build>
网友评论