• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

image from database display

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 245
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Water proof donuts! Eat them while reading this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic