DIGIT-ARC read-only archive · snapshot: July 23, 2026

images not displayed when running page through local server

5 posts · originally from https://geek.digit.in/community/threads/images-not-displayed-when-running-page-through-local-server.103543/

D
dhiraj_ Original post #1
Dec 3, 2008 at 11:42 PM
Hello this is Dhiraj!!

I've been making this project in JSP+HTML and I am facing this problem...

When I try to run an HTML file from my local server the images of the page do not get displayed properly. Everytime few of the images are shown missing.

But when I try and simply run the HTML file without the server then the images are properly displaying....what could be the problem?

I am using Tomcat Apache server and have been trying to run pages in both Firefox and IE.

Can somebody help me with that.
T
Dec 3, 2008 at 11:44 PM
relative URLs maybe? very probable I think.
Make them absolute.
B
Bandu #3
Dec 4, 2008 at 12:08 AM
relative URLs should be fine. Post your directory structure.
D
dhiraj_ #4
Dec 4, 2008 at 12:39 AM
relative URLs should be fine. Post your directory structure.


..as all the images for a page are in separate images folder.
The directory structure is
jakarta-tomcat-5.5.9/webapps/ROOT/Dhiraj/images/header1_r2_c4.gif

Why there is difference...the exact problem is some of the images from that folder are displayed and some are not.
B
Bandu #5
Dec 4, 2008 at 12:46 AM
As you said earlier that some are displayed and some are not, I guess it must be the case that the images are displayed on a certain page of your application and not displayed entirely on some other page. Might be because the later one is in a different directory structure.

To refer the image from a html / jsp, say in ROOT/Dhiraj you will have to write
Code:
<img src='images/header1_r2_c4.gif'/>

But, if the file using the image is in say, ROOT/someotherfolder, then it would be:

Code:
<img src='[B]../[/B]images/header1_r2_c4.gif'/>

Do let me know if we are on the same lines. If possible, paste some snippets of conditions where the images don't work.