• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IMG not displayed when inside server (tomcat)

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

I have a very simple page, sample.html, with nothing inside but 1 img tag



If I open this sample.html by double-clicking it in windows explorer, it opens as expected.

If it is served from the server, the image is not displayed.

Any thoughts?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why would a page served from a server include an image tag that references an image that's on the client? This page would only work on your machine, not anywhere else.
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ulf Dittmer:
Why would a page served from a server include an image tag that references an image that's on the client? This page would only work on your machine, not anywhere else.



Sorry I just realized that; i asked the wrong question.

Actually, my problem is:

I have an empty table TD tag, with id, like below:



Now, I use javascript .innerHtml to put an IMG tag inside it, as below:



The image is not displayed.

(I checked by checking the value of the imageHolder and I get the correct data "<img src='C:/image/A.jpg'>", but there is no image displayed.)
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've never tried that (as I said, I don't think it makes much sense), but it could be a security restriction that pages from a server are not allowed to reference local files.
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The page is already served at the client when I triggered the change for IMG tag.

The image exists in the client PC.

I also am looking at the possibility that it is related to security.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most modern day browsers do not let you link to local files.

Eric
 
Jesus Angeles
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Eric Pascarello:
Most modern day browsers do not let you link to local files.

Eric



If say I will allow even there is security hole on the resolution, is there any such way, so that I can do so and have my image displayed?
 
reply
    Bookmark Topic Watch Topic
  • New Topic