java - 当我尝试在 Spring Mvc 中插入背景图像时,它没有出现
问题描述
我正在尝试使用 Spring MVC 构建一个天气刮板网站。目前,我正在尝试设计网站。当我尝试为此设计插入背景图像时,当我查看 URL (http://localport:8080/weatherScraper) 时,它似乎没有出现。但是,其余元素按预期显示。
我的控制器类:
公共类控制器{
@RequestMapping(value = "/weatherScraper", method = RequestMethod.GET)
public String webpageGet(ModelMap modelMap){
return "Mainpage";
}
}
我将图像保存为weather.jpg。我什至尝试了 <body background = "weather.jpg" 和 <body style="background-image:url("weather.jpg")" 并且尝试了很多其他不同的方法,但它仍然对我不起作用。有人可以帮我解决这个问题吗?
解决方案
推荐阅读
- mongodb - mongod:错误:子进程失败,以 100 退出
- html - 填满整个屏幕宽度的图像
- excel - 将单元格范围从一张纸剪切到另一张纸
- javascript - 使用 Next js 和 express 进行电子邮件验证
- c# - MailMessage 附加到字节 []
- javascript - 检查谷歌脚本上的单元格是否为空
- networking - 将请求从计算引擎 (GCP) 转发到本地 API
- c# - Blazor 服务器 - 从当前登录用户获取 AAD 访问令牌
- sql - 从文本字段中查找子字符串的出现次数
- powershell - PowerShell:使用 Try-Catch 调用命令