• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

<img> tag not showing the image

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi guys,

I have just started reading HFSJ book for scwcd exam.

In which directory should i store the image files of my html file.

I have installed the tomcat and set the classpaths accordingly [its running], i have placed my test.html file in ROOT directory and than accessed it via.



the form and the messages are showing up but the picture is not showing, i guess there is a particular directory where i should put the images, but the tomcat test page is accessing the tomcat.gif from the same page???

i have used this html code for the image



any idea ???

regards,
rafi

The Directory Structure is:
D:\tomcat\Tomcat 5.5\webapps\ROOT

my both test.html & abc.jpg is stored in ROOT directory.

here is the code



if i double click on the file from ROOT directory than it will display the picture,
else if i run the file via http://localhost:8080/test.html than the picture will now show, but the rest of the form will show (just the picture will now show).

regards,

Rafi
 
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
in the same dir as your html file....because you want them to be accessible by your clients directly without going through the DD....
 
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it should be in the same directory where the html file is placed.
 
Ranch Hand
Posts: 72
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your web app under /webapps/yourFolderName?

Then your image should be just in the same place.

However, I suggest you create a seperate forlder for images. And the refer to that folder image file....

Try it.. I am also new here..
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please UseAMeaningfulSubjectLine for your topics...
 
Rafi Fareen
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Swagato Bhatta wrote:Is your web app under /webapps/yourFolderName?

Then your image should be just in the same place.

However, I suggest you create a seperate forlder for images. And the refer to that folder image file....

Try it.. I am also new here..




that is what i have tried .... kept the picture in the same folder as test.html file [ROOT]. When i run the html file directly by double clicking than it will show the picture, but when i run it from http://localhost:8080/test.html than it displays everything else, but not the picture only.

 
Rafi Fareen
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ankit Garg wrote:Please UseAMeaningfulSubjectLine for your topics...



roger that ..... from next time.
 
Harpreet Singh janda
Ranch Hand
Posts: 317
Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you please post the entire code and directory structure of your application?
 
Sheriff
Posts: 7135
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rafi Fareen wrote:roger that ..... from next time.


Please do it now. Please edit your post to add a meaningful subject line by clicking the button.
 
reply
    Bookmark Topic Watch Topic
  • New Topic