<div id="Canvas"
style="background-image: url(../../assets/images/doctor/ecg/ecg_back.png);
position:relative; height:250px;width:1000px;">
如何访问assets / images / doctor / ecg / ecg_back.png中的图像,从设置了视图中存在的gsp中的背景图像/ ECGView.gsp
答案 0 :(得分:3)
您应该能够将图像作为资源访问。
<div id="Canvas" style="background-image:url('${resource(dir: "images/doctor/ecg/", file: "ecg_back.png")}');height: 250px;background-repeat: no-repeat;background-position: center;width:1000px;">
答案 1 :(得分:2)
您可以使用assetPath
taglib来执行此操作。例如:
<div style="background-image: url(${assetPath(src: '/whatever/path/under/assets/image.png')});">...</div>