【发布时间】:2015-09-10 19:50:10
【问题描述】:
String mailBody = "<div style='margin-left:10px;'>"
+"<div style='font-weight: bold; font-size: 19px; padding-top: 8px;'>Anindya</div>"
+"<div style='font-size: 17px;'>Senior Salesforce with Oracle Developer</div>"
+"<div style='margin-top:5px;padding-bottom: 4px; font-size: 12px;'><img src="+resourceRequest.getContextPath()+"/images/icon/Mobile-phone.png\" height='16' width='16'></img>9830093200</div>"
+"<div style='padding-bottom: 4px; font-size: 12px;'><img src='../images/icon/location-icon.png' height='16' width='16'></img>Kolkata</div>"
+"<div style='display:inline-block;padding-bottom: 4px; font-size: 12px;'><img src='../images/icon/email-icon.png' height='16' width='16' style='float:left;margin-right:2px;'></img><div style='float:left;'>anindyamallik@gmail.com</div></div>"
+"</div>";
I want to show this string in a pop up, but while showing to pop up the
谁能帮帮我吗?
【问题讨论】:
-
你能检查生成的html吗?生成的图片 URL 是否有效?
-
使用firebug我可以看到它显示加载图片URL失败
-
你得到的 resourceRequest.getContextPath() 的值是多少?
-
resourceRequest.getContextPath() 一定有问题。尝试使用 request.getContextPath(),其中 request 是 httpServletRequest 对象。它将为您提供应用程序的有效上下文路径。
-
这很容易在浏览器开发工具网络中进行故障排除。查看发送到服务器的失败 url 并进行相应调整。