suraj
suraj

Reputation: 1898

Loading images for HTML in jboss

I have HTML pages that I put inside temp folder(Outside WEB-INF directory). I have used some images inside my HTML pages. I have put those images also in temp folder and then I created my war file. When I run that in localhost, Images are not loaded into HTML pages. It shows all the contents except Images.

Then I created a folder images outside WEB-INF directory, put all image files into that and created war file. But the result was same. Can anyoe tell Where I am going wrong?

Upvotes: 3

Views: 3472

Answers (3)

Ashwin
Ashwin

Reputation: 13547

Have you checked whether the .gif file is in Uppercase or Lower case(you can get this information when you make the war file from command prompt).
If the "gif" is in Uppercase in the war file and you have given it as <image background="bg.gif">, then change it to <image background="bg.GIF">. I think this is the problem you are facing.

Upvotes: 0

souser
souser

Reputation: 6124

I have two suggestions for you for serving static content without modifying the war file. The first is what I would recommended.

  1. Setup Apache as front end proxy and use Apache to serve the static content
  2. Copy the static content into ROOT.war under directory say static and then reference the static content as "/static/logo.gif".

Upvotes: 0

uaarkoti
uaarkoti

Reputation: 3657

What might really help is if you can share the structure of your WAR file and also a sample html snippet that shows how you are referring to those image files. The problem maybe the way you are referring to those image files.

Let me answer this question with an example

Lets assume your war structure is as follows

webapp.war
 |
 |---> WEB-INF
 |------|
 |      ----> classes
 |---> index.html
 |---> images
 |-------|
 |       ----> logo.gif

The way you'd refer to the image file is as follows

If you are doing this correctly and still not able to view the image files, you need to share some more details as I mentioned above.

Hope this helps.

Good luck!

Upvotes: 1

Related Questions