Win a copy of Practice Tests for OCP Java 17 Certification Exam (1Z0-829) this week in the OCPJP forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Scott Selikoff
Bartenders:
  • Piet Souris
  • Jj Roberts
  • fred rosenberger

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.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic