Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

display image problem on jsp

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

when i tried to display images on jsp page, sometimes it shows all the image, but sometimes it fails to show couple of images, for those failed images, there are small 'x' on the images.

can anyone please help?

Thank you
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's likely your URLs to the images are bad.

Be sure that you are using server-relative URLs that being with the context path. See the JspFaq for more information.
 
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The little "X" means that the URL doesn't point to an image. So, fix your code so that the URL does point to an image.

You may think that is kind of vague. Well, it is. However given the level of detail in your post, that's pretty much all that can be said.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:The little "X" means that the URL doesn't point to an image. So, fix your code so that the URL does point to an image.

You may think that is kind of vague. Well, it is. However given the level of detail in your post, that's pretty much all that can be said.




thank you for your reply. but my problem is that if you refresh the page, the image will shows up . but sometimes fails, or some other images might disappear.

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is generating the image URLs?

Which browser is being used to look at the HTML?

What is serving the images? If it is your server, what do the logs have to say?


Bill
 
Paul Clapham
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jim li wrote:thank you for your reply. but my problem is that if you refresh the page, the image will shows up . but sometimes fails, or some other images might disappear.



So there's apparently some kind of random behaviour? You should observe more carefully to see whether it's really random or whether it is actually systematic in some way. As I suggested before, just saying "Weird stuff is happening" isn't a good basis for problem-solving.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Brogden wrote:What is generating the image URLs?

servlet by using response

Which browser is being used to look at the HTML?

firefox and ie

What is serving the images? If it is your server, what do the logs have to say?
i got images back from the mysql db

Bill

 
Paul Clapham
Marshal
Posts: 27211
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

jim li wrote:i got images back from the mysql db



Somehow you forgot to mention that before. It might be an important detail. So I suggest you pause for a minute and write up a description of what you are doing, how you are doing it, what you expect to happen, what happens instead, and any other relevant information. "Images don't appear" just doesn't cut it as a problem description.
 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

jim li wrote:i got images back from the mysql db



Somehow you forgot to mention that before. It might be an important detail. So I suggest you pause for a minute and write up a description of what you are doing, how you are doing it, what you expect to happen, what happens instead, and any other relevant information. "Images don't appear" just doesn't cut it as a problem description.




i am using jsp to display images from mysql database.

on each jsp page i expect to display more than one image, but sometimes not all images are not displayed properly, like a small x on the image.

if i refresh the page, the images might appear.
 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic