• Post Reply Bookmark Topic Watch Topic
  • New Topic

display images from folder through database dynamically

 
Karamjeet singh
Ranch Hand
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am storing image name in database
and retrieving by img src tag in jsp and servlet
nothing happening
when i run the code it shows some red cross sign in place of image
please help

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to serve non-local resources through an image servlet, of which there are countless examples on the web.

Please see the JavaRanch naming policy. Please change your display name to conform with this policy. Thanks!

And welcome to JavaRanch!
 
Karamjeet singh
Ranch Hand
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i google through web and also found the code
but nothing works
so i came here
to find solution of my problem
 
Paul Clapham
Sheriff
Posts: 21866
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, your search returned some information (which we don't know what it is) and you've tried a lot of things which "didn't work" (and which we don't know what they are).

It's pretty difficult to suggest anything now, because we have no idea what you tried so far. Therefore I suggest you post something which you have which you think might be close to working, and we can try to fix that up.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
karamjeet singh wrote:i google through web and also found the code
but nothing works
so i came here
to find solution of my problem


You found code on the web which suggested to do what you have posted in your original post? That's just never going to work.

This question sure comes up a lot. Java Ranch needs an Image Servlet FAQ

Anyway ... As David said, you need an Image Servlet.
 
Karamjeet singh
Ranch Hand
Posts: 52
Flex jQuery Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't mind
if you, but i got solution
i try to solve it and it solved
the code:



well any how thanks
 
Paul Clapham
Sheriff
Posts: 21866
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aha. Just a matter of getting the URL right then.
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see. I thought the image was in the file system on your computer, not within the web application.

Great that you got it resolved.

Best Regards,
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!