Loading images for HTML in jboss

I have HTML pages that I put in a temporary folder (external WEB-INF directory). I have used some images inside my HTML pages. I put these images also in temp folder and then created a war file. When I run it on localhost, the images are not loaded into HTML pages. It displays all content except images.

Then I created images of folders outside the WEB-INF directory, put all the image files in it, and created a war file. But the result was the same. Can anyoe tell where I am going wrong?

+3


source to share


3 answers


You checked if the .gif file is in upper or lower case (you can get this information when you make a war file from the command line).
If "gif" is uppercase in war file and you specified it as <image background="bg.gif">

, then change it to <image background="bg.gif">

. I think this is the problem you are facing.



0


source


Which can really help if you can share the structure of your WAR file as well as a sample html snippet that shows how you feel about these image files. The problem might be how you are accessing these image files.

Let me answer this question with an example

Let's assume your military structure looks like this

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

      

The way to access the image file is as follows



If you are doing this correctly and still cannot view the image files, then you need to share some details as I said above.

Hope it helps.

Good luck!

+1


source


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

  • Install Apache as a proxy and use Apache to serve static content.
  • Copy the static content to the ROOT.war directory in the static directory and then specify the static content as "/static/logo.gif".
0


source







All Articles