0

Hello friends,
I want to display an image in my JSP using expressions (<%=abc%>)tag. But, the problem is that the JSP does not show the image.
I store the path retrieved from database (MS SQL) in a "path" variable and then try to display it in JSP using <img> tag.

The code is as follws:
<img src="<%=path%>" mce_src="<%=path%>" width="260" height="261" border="2" >
where, path="temp/" + image; //temp is the folder containing image
//image=image name corresponding to user logged in,since,image is stored with name same as user name.

Is there anything else that should be included in the code?
Is the src path right?
In my other JSPs where i directly give image names, images are displayed. Then why not here? I think the problem is in src="<%=path%>" , but can't figure it out.

Please help.
THANK YOU.

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by jwenting
0

Let me clear it out.
I accept an image from users and store them in byte format in database at the same time i convert the bytes to image and store it in "temp" folder with name - "username+image type".
While retrieving, i specify the image name in "path" variable so as to retrieve it directly from folder and not database.
Yet, the image is not displayed.Please help.

0

what's actually generated as code and sent to the browser?
Almost certainly the paths shown there are utterly incorrect and have no relation whatsoever to the paths of the images relative to the deployroot of the web application.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.