Reputation: 5219
I'm trying to create jsp page that contains chart and tool tip on the chart. I got to this point: I have a chart as image in my jsp page. I have String that contians the html tag map with all the data about the tool tip.
I am looking for a way to take the String with all the data and put it in my jsp page as regular html tag.
I tried to use :
<h:graphicImage id="linkGraph"
value="#{myBean.fileName}"
usemap="#{myBean.mapPath}"
width="#{myBean.width}"
height="#{myBean.height}"
rendered="true"
style="border-color: #ffffff;/>
#{myBean.mapHtml}
I'm getting it as text in my jsp page
Upvotes: 1
Views: 1344
Reputation: 5219
I found a way to do it. Create simple tag(div, span....) with id="tag" and with the help of java script function
function replaceString(str) {
document.getElementById("tag").innerHTML = str;
}
Upvotes: 0
Reputation: 9579
Have you included the correct headers in your JSP, i,e:
<%@page language="java" %>
<%@taglib prefix="h" uri="[taglib url]" %>
EDIT:
To enable Expression Language:
<%@ page isELIgnored="false" %>
Then get your bean:
<jsp:useBean id="myBean" class="fully.qualified.bean.class.MyBean"/>
And then use it in your tag:
<h:graphicImage id="linkGraph"
value="${myBean.fileName}"
usemap="${myBean.mapPath}"
width="${myBean.width}"
height="${myBean.height}"
rendered="true"
style="border-color: #ffffff;/>
${myBean.mapHtml}
Note the ${byBean.property} expressions, with a $ not a #: your bean class needs matching getter methods, i.e. getFilename(), getMapPath() etc.
Upvotes: 1