facebook

[Closed] HTML images work in design, fail when deployed

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #270898 Reply

    rickmschafer
    Member

    I have a WEB Project that I am developing using an image on an HTML page, however at runtime it shows a broken link for all the images I have. I know it may be just a configuration issue, however I can’t seem to correct it. I am using the latest of everything, 5.5m2 and Tomcat. In design mode I see it however when I try to run this from the IDE it does not work. I have my image directory under c:\MyProject\WebRoot\WEB-INF\img What am I doing wrong?

    #270937 Reply

    Loyal Water
    Member

    Seems like a mapping problem at runtime. You need to check if you are using the correct RELATIVE PATH. Try hard coding the path of the image and see if that works. You img folder should be in the same directory as the html file and then use a Relative Path which looks something like “img/<image name>.jpg”

    #270956 Reply

    rickmschafer
    Member

    so my physical path is c:\home\Project\WebRoot\Login.html for my page and c:\home\Project\WebRoot\WEB-INF\img\myimage.jpg for the image within the page. The relative path is /WEB-INF/img/myimage.jpg. Is there a global setting for my projects images? Does this need to be setup in TomCat?

    #270997 Reply

    Riyad Kalla
    Member

    rick,
    WEB-INF is a protected directory. You cannot access anything in it publically. You need to move your images under the root of your project (WebRoot\img) and update all your paths.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: [Closed] HTML images work in design, fail when deployed

You must be logged in to post in the forum log in