Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

image from database display  RSS feed

 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all!
i am having an application in which after search some results are available and need to be displayed.what i dont know is how i could display an image in my jsp page..i have this code:

and then to display the image i try the following,which doesnt work


any thoughts?thanks!
 
Vikrant Pandit
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Just use



You need a JSP expression , not a JSP scriptlet . I hope that helps
 
natasa jones
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i use <img src="<%=myMovie.getImagePath();%>" alt="movieImage"/> then i get an error.so i use <img src="<%=myMovie.getImagePath()%>" alt="movieImage"/> but my image doesnt appear...
 
Rashid Mayes
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Natasa's advice is correct. I believe the ";" where simply typos. Have you checked the value of image path. Open the page in your browser and select view source and copy the value of IMG.SRC to another window. Verify that the image path points to image's home on the web. Check to see if you get a 404, 500, 403, etc.

Sometimes a quick visuall inspection is all that is needed to discover the root of the problem.

In your original question you did not specify if the image itself was stored in the database, file system, etc.

Can you post the value of myMovie.getImagePath()? This would help us help you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!