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 ?
-
Verify the name of image file and name and path at <img/> tag.KV Prajapati– KV Prajapati2012-01-03 05:48:23 +00:00Commented Jan 3, 2012 at 5:48
-
which code..?post atleast that code portion that you are trying to display image.TKV– TKV2012-01-03 05:48:43 +00:00Commented Jan 3, 2012 at 5:48
-
I have verified many times the path and file name.alessandro– alessandro2012-01-03 05:51:28 +00:00Commented Jan 3, 2012 at 5:51
-
@Tijo, the bold letter code is which I use to display image.alessandro– alessandro2012-01-03 05:53:16 +00:00Commented Jan 3, 2012 at 5:53
-
Create a folder under root (say images) of web-app, copy that file in it and use relative path.KV Prajapati– KV Prajapati2012-01-03 06:08:07 +00:00Commented Jan 3, 2012 at 6:08
Add a comment
|
2 Answers
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"/>