尝试从java字符串中插入html标记值

时间:2016-08-04 22:30:39

标签: java jsp

尝试找到将字符串值插入java的jsp标记的正确方法。具体而言,java中字符串的值是标记文件路径值所需的值。

jsp文件:

 <img src="<% ... %>" alt="phoneIcon" height="16" width="16">

java文件:

public void iconString(HttpServletRequest request, HttpServletResponse response) {
        String phoneIconPath = "file:\\\\e:\\Workspace\\ProjectX\\WebContent\\images\\phone.ico";

        request.setAttribute("phoneIconPath", phoneIconPath);
    }

0 个答案:

没有答案