• Post Reply Bookmark Topic Watch Topic
  • New Topic

display image problem on jsp

 
jim li
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • 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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • 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.
 
Paul Clapham
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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.

 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
Sheriff
Posts: 21876
36
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!