  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | JSP - A mailing list about Java Server Pages specification and reference | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Displaying Generated Image on Jsp | Displaying Generated Image on Jsp 2004-12-17 - By Ben Hill
Back At a guess, you could have a servlet that grabs the image from the database, and outputs it to the output stream. So your IMG code in the HTML doc would look something like: <img src="/servlet/ImageServlet?id=1" alt="/servlet/ImageServlet?id=1&comment=true" /> The servlet could grab the blob from the database and write it out. HTH Ben
-- --Original Message-- -- From: Govind Kotwani [mailto:govind.kotwani@(protected)] Sent: 17 December 2004 09:52 To: J2EE-INTEREST@(protected) Subject: Displaying Generated Image on Jsp
Hi, We have web J2EE web based application which is deployed on weblogic 8.1(on Unix) as an ear. This EAR contains some EJB's some jar files and a war file. Now we want to display an image on the jsp after retreiving it from the database.Image is stored in the database as a BLOB object. Currently what is implemented is e.g as soon as user selects a product an image file (.jpg) is generated from the BLOB object (at some predefined location say C:\ImageFolder) and in jsp(HTML) we display this image with with giving this path in IMG src tag. Is there any way where we can get rid of this absolute path(hard coded) path and generate the image at a relative path and display from there in our jsp or is there any other wat to achieve it. Thanks Govind Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you =========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
********************************************************************
This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person Thank you
Check us out at http://www.bt.com/consulting
********************************************************************
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>Message</TITLE> <META http-equiv=Content-Type content="text/html; charset=us-ascii"> <META content="MSHTML 6.00.2800.1458" name=GENERATOR></HEAD> <BODY> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2>At a guess, you could have a servlet that grabs the image from the database, ando utputs it to the output stream. So your IMG code in the HTML doc would look something like:</FONT></SPAN></DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2><img src="/servlet/ImageServlet?id=1" alt="/servlet/ImageServlet?id=1&comment=true" /></FONT></SPAN></DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2>The servlet could grab the blob from the database and write it out.</FONT></SPAN></DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2>HTH</FONT></SPAN></DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2></FONT></SPAN> </DIV> <DIV><SPAN class=922362410-17122004><FONT face=Arial color=#0000ff size=2>Ben</FONT></SPAN></DIV> <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"> <DIV></DIV> <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT face=Tahoma size=2>-- --Original Message-- --<BR><B>From:</B> Govind Kotwani [mailto:govind.kotwani@(protected)] <BR><B>Sent:</B> 17 December 2004 09:52<BR><B>To:</B> J2EE-INTEREST@(protected)<BR><B>Subject:</B> Displaying Generated Image on Jsp<BR><BR></FONT></DIV><BR><FONT face=sans-serif size=2>Hi,</FONT> <BR><BR><FONT face=sans-serif size=2>We have web J2EE web based application which is deployed on weblogic 8.1(on Unix) as an ear.</FONT > <BR><FONT face=sans-serif size=2>This EAR contains some EJB's some jar files and a war file.</FONT> <BR><BR><FONT face=sans-serif size=2>Now we want to display an image on the jsp after retreiving it from the database.Image is stored in the database as a BLOB object.</FONT> <BR><FONT face=sans-serif size=2>Currently what is implemented is e.g as soon as user selects a product an image file (.jpg) is generated from the BLOB </FONT><BR><FONT face=sans-serif size=2>object (at some predefined location say C:\ImageFolder ) and in jsp(HTML) we display this image with with giving this path in</FONT> <BR><FONT face=sans-serif size=2>IMG src tag.</FONT> <BR><BR><FONT face=sans-serif size=2>Is there any way where we can get rid of this absolute path(hard coded) path and generate the image at a relative path and display </FONT><BR><FONT face=sans-serif size=2>from there in our jsp or is there any other wat to achieve it.</FONT> <BR><BR><BR><FONT face=sans-serif size=2>Thanks</FONT> <BR><FONT face=sans-serif size=2>Govind</FONT> <TABLE> <TBODY> <TR> <TD bgColor=#ffffff><FONT color=#000000>Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you<BR></FONT></TD></TR></TBODY></TABLE>===================================== ====================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help". <P></P></BLOCKQUOTE><CODE><FONT SIZE=3><BR> <BR> ********************************************************************<BR> <BR> This email may contain information which is privileged or confidential. If you are not the intended recipient of this email, please notify the sender immediately and delete it without reading, copying, storing, forwarding or disclosing its contents to any other person<BR> Thank you<BR> <BR> Check us out at http://www.bt.com/consulting<BR> <BR> ********************************************************************<BR> </FONT></CODE> </BODY></HTML>
|
|
|