Images in servlet

Hi, I am having a problem with images showing up in a servlet.
I have read other peoples questions having the same problem, and have made some adjustments, but am still having the same problem.

The image files now are contained in Tomcat_Home\ROOT\Images.

The source returned by the servlet is as this line.
<td width="14%"> <div align="center"><font color="#000066"><img src="../../../ROOT/Images/Q_c.gif" width="24" height="21"></font></div></td>

If the source is saved as a html page, and reopened, the images show-up just fine.

Any help would be appreciated.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is ROOT your web context? If not, it's a protected resource
RockyFullenAuthor Commented:
I do not know what you mean by web context.
So what do I need to do?
Try (note the leading '/');
<img src="/../../../ROOT/Images/Q_c.gif" width="24" height="21">
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.


I think that it would be the problem of the path in the Servlet.

Try to give the full path of your images by
<img src="/ROOT/Images/Q_c.gif" width="24" height="21">

Would that solve your problem?

RockyFullenAuthor Commented:
Ok, I got the images to show - up by moving them into the web context path.
There now is another problem.
I have placed a background image in the same path as the other images, and
have set the backgroung in the servlet. The background, however does not show-up.
Any more ideas??

This line works
 <td><font color="#000033"><div align="center"><img src="../Q_c.gif" width="24" height="21"></div></font></td>

This line does not work
<body background="../paper.jpg">
This line does not work
<body background="../paper.jpg">

Make sure that file is in the same directory as Q_c.gif and in the right spelling case

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.