Maven Spring MVC:无法识别背景图像
Maven Spring MVC : Background image not recognising
我正在开发一个 spring mvc maven 项目,这是我的文件结构:
[1]: https://i.stack.imgur.com/hSW66.png
body {
background: url("/WEB-INF/Images/Image/tests.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
这是我css显示的背景图片。但由于某种原因,图像没有显示。请帮忙。
你必须在 xml 配置中告诉 spring 访问静态资源的路径
“resources”为项目中的文件夹,“res”为请求映射
我正在开发一个 spring mvc maven 项目,这是我的文件结构: [1]: https://i.stack.imgur.com/hSW66.png
body {
background: url("/WEB-INF/Images/Image/tests.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
这是我css显示的背景图片。但由于某种原因,图像没有显示。请帮忙。
你必须在 xml 配置中告诉 spring 访问静态资源的路径