• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

retrieve photo

 
smitha mano
Ranch Hand
Posts: 70
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai all

in my Emp table

id,name,photoName,remarks

i stored photo in to the server/deploy/test.war/images/Lura.jpg ,inthe table i stored only the nname of the photo

i needed, how i retrieve photoname and display photo on jsp page?

please help me...........
 
Scheepers de Bruin
Ranch Hand
Posts: 99
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read the naming policy of the site!

Remember paths of stuff in your WAR file is relative.

So if you images are stored in /images in your WAR file, you could use the following to display an image on a .jsp:

<%
// put your code to retrieve the filename from the db here
// lets assume you put it in a String called "filename":
filename = "myimage.jpg";
%>
<img src="/<%=request.getContextPath%>/images/<%=filename%>">
[ September 27, 2005: Message edited by: Scheepers de Bruin ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic