This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes retrieve photo Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "retrieve photo" Watch "retrieve photo" New topic
Author

retrieve photo

smitha mano
Ranch Hand

Joined: Sep 26, 2005
Posts: 70
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

Joined: Jul 19, 2005
Posts: 99
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 ]

We're doomed!!<br />Yay!!!<br />No that's bad Girr!!<br />Yay!!!
 
Consider Paul's rocket mass heater.
 
subject: retrieve photo
 
Similar Threads
Stored procedure question
How to display image in JTable which is stored in database.
Getting database data to the UI
how to compare sql date
to retrieve data from an image type in ms sql