Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Where do I need to put my "images" folder in Eclipse project?(Where do I need to put my "images" folder in Eclipse project so that images appear when I run my html page?)
Where do I need to put my "images" folder in Eclipse project? [message #942599] Sat, 13 October 2012 13:38 Go to next message
Dusan Cankovic is currently offline Dusan Cankovic
Messages: 1
Registered: October 2012
Junior Member
I have just started using eclipse for web development, so please help

Where do I need to put my "images" folder in Eclipse project so that images appear when I run my html page?
Example of html code:

<img src="images/garagedoor.jpg" style="max-width:100%; max-height:100%;" id="slika" onclick="onClick_Pocetna()" />

I have tried putting "images" folder in "MyProject/Web Content/" folder, where my html, css, js files are also located, in root of the whole project "MyProject/, in "Java Resources/src/" folder,
and nothing worked so far.
I tried changing the src of html to

src="http(etc)/MyProject/WebContent/images/garagedoor.jpg"

or

src="http(etc)/MyProject/images/garagedoor.jpg"

and that didn't work either.

I am running my html page on Tomcat 6.0 server.

Please help!
Thanks
Re: Where do I need to put my &quot;images&quot; folder in Eclipse project? [message #942751 is a reply to message #942599] Sat, 13 October 2012 17:16 Go to previous message
Russell Bateman is currently offline Russell Bateman
Messages: 3121
Registered: July 2009
Location: Provo, Utah, USA
Senior Member

On 10/13/2012 11:38 AM, Dusan Cankovic wrote:
> I have just started using eclipse for web development, so please help
> Where do I need to put my "images" folder in Eclipse project so that
> images appear when I run my html page?
> Example of html code:
>
> <img src="images/garagedoor.jpg" style="max-width:100%;
> max-height:100%;" id="slika" onclick="onClick_Pocetna()" />
>
> I have tried putting "images" folder in "MyProject/Web Content/" folder,
> where my html, css, js files are also located, in root of the whole
> project "MyProject/, in "Java Resources/src/" folder, and nothing worked
> so far.
> I tried changing the src of html to
> src="http(etc)/MyProject/WebContent/images/garagedoor.jpg"
>
> or
>
> src="http(etc)/MyProject/images/garagedoor.jpg"
>
> and that didn't work either.
>
> I am running my html page on Tomcat 6.0 server.
>
> Please help!
> Thanks

Posts on web development topics typically go into the Eclipse web tools
platform forum. I don't monitor that forum any more so I'll help from
here, but the guys in that forum are pretty good and pretty helpful.

WebContent/images/garagedoor.jpg is the correct location for something
to be accessed via <img src="images/garagedoor.jpg" />.

There must be something else awry. I hope you misspelled "Web Content"
in your question. If not, that may be a problem (there shouldn't be a
space). There are so many other things that could be wrong.

Look under
<workspace>/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps
to see if there is an images subdirectory. This is where Eclipse
publishes your Dynamic Web Project for Tomcat to run.

Are you able to access anything else in your project when you run it?
That much wasn't too clear. If you're not getting any grunts at all out
of your project, your web.xml may be wrong.
Previous Topic:unable to launch scrapbook vm
Next Topic:Starting Eclipse Juno SR1 on OpenSuse 12.2 64 bit
Goto Forum:
  


Current Time: Wed Jul 23 18:15:12 EDT 2014

Powered by FUDForum. Page generated in 0.01455 seconds