alessandro
alessandro

Reputation: 1721

JSP - Display Image Issue

I am using code < img src="C:/NetBeanProject/images.jpg" alt="abc" width="42" height="42"/> to display an image to my jsp page. However, the image is not shown in the page. Is there any wrong with that code ?

Upvotes: 0

Views: 1391

Answers (2)

KV Prajapati
KV Prajapati

Reputation: 94645

In web-app, images and public resources must be located at folder under the root. You should have to create folder "images" under "web" (netbeans project) and move images.jpg in images folder.

web/
   |___/images
   |      images.jpg
   |
   | index.jsp

In index.jsp,

<img src="images/images.jpg" alt="logo"/>

Upvotes: 1

TKV
TKV

Reputation: 2663

avoid the space inside img tag before img like <img src="C:/NetBeanProject/images.jpg" alt="abc" width="42" height="42"/>.

It will work.

There was some space is space is showing in your code inside img tag.

Upvotes: 1

Related Questions