Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding image to eclipse web project

Well, this is embarrasing...I can't seem to be able to add a humble image to a java web project in eclipse. What I did was that I created a folder called images inside WebContent, and then tried adding it in two ways, directly pasting it and using add/file, and advanced, which basically asks for a route to the image insider the hard drive.

The HTML syntax is here:

<img border="0" src="WebContent/images/network.jpg"
     alt="Pulpit rock" width="304" height="228">

I tried it with and without WebContent. I am sure there's something I'm missing, but after a couple hours decided to get help.

Thanks in advance for any assistance.

like image 524
carlos palma Avatar asked Oct 15 '13 16:10

carlos palma


1 Answers

You should in general try to avoid absolute paths. Specifically I believe from a normal web project you should try something like:

<img border="0" src="images/network.jpg"
     alt="Pulpit rock" width="304" height="228">

Which works like a charm for me.

like image 54
Elemental Avatar answered Oct 24 '22 02:10

Elemental