No mapping found for HTTP request with URI [/xxx/xxx] in DispatcherServlet with name 'xxx'

No mapping found for HTTP request with URI [/xxx/xxx] in DispatcherServlet with name 'xxx'。

网上的方法都没用,最后发现src/main/resources下的资源没用打包进WEB-INF/classes

用maven构建的项目理论上会打包进去,既然不行就手动添加。

在pom.xml的<bulid>标签加入以下

<bulid>
    <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
    </resources>
</bulid>

猜你喜欢

转载自blog.csdn.net/b515833/article/details/83006719