ken
ken

Reputation: 155

Image not displaying in jsp

I have my image placed in a folder called images in the netbeans web pages folder and the link to it in my jsp is in a div as shown below:

<div id="image">
  <p>
    <img src="${pageContext.request.contextPath}/images/vote_image.GIF"
         alt="banner"
         width=600px
         height=300px
    />
  </p>
</div><!--end of image div-->

The problem is the image just doesn't load in the browser. What could be the problem? I used the same code in linux and it used to load the image. Could it be a browser problem, I'm using firefox 3.6 which I don't think should have a problem. Please let me know if any one has a clue as to why this is happening. If the problem is my code let me know how to adjust. Thank you

Upvotes: 2

Views: 3600

Answers (1)

ajm
ajm

Reputation: 20105

There are no units used in HTML width and height attributes.

<img src="${pageContext.request.contextPath}/images/vote_image.GIF"
     alt="banner"
     width="600"
     height="300"
  />

Without seeing the rendered source of the page, I'd guess that's your problem. If not, try inspecting your image in Firebug and post what its rendered source looks like.

Also, make sure case sensitivity is not in play: gif vs. GIF.

Upvotes: 1

Related Questions