Hi all,
Is it possible to display a java object(by pointing it in iframe src) obtained from a servlet(In a jsp page) in an Iframe?
Here is what I've tried. I'm storing a pdf file in mysql database as blob type. In the Hibernate bean class I have declared the corresponding variable as Byte[].
Now I'm trying to display the object through Iframe like this.
<% String oid = null;
oid = request.getAttribute("oid").toString();
request.setAttribute("oid",oid);
%>
<jsp:useBean id="cusBean" class="com.zoran.action.CustomBean" scope="page" >
<jsp:setProperty name="cusBean" property="parentId" value="1" />
<jsp:setProperty name="cusBean" property="parentType" value="FILE" />
</jsp:useBean>
<iframe id="displayFrame" src="<%= cusBean.getFile() %>" width="1000" height="500" FRAMEBORDER="0" value="1"></iframe>
And custom bean is the java class where I'm running the hql script to return the blob data through cusBean.getFile().
Am I right in doing this? how else can I print a java object variable in an Iframe.
Please help me out on this.
Thanks, Aditya