| Author |
Display image which is store in database
|
chain singh
Ranch Hand
Joined: Feb 28, 2012
Posts: 116
|
|
Hello
I am using sqlserver database where i have one table called image_master and just one column called user_image of image type.
I see some examples on that forum like
but i dont want to use src="images/Beanie/<%=rs.getString("Image") %>" this complete path i just want to use file from database.
like <%=rs.getString("user_image")%> and this insert image in code.
please help me
thanks in advance
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
JSP is a template technology that creates an HTML page to send to the browser. So the browser gets an HTML page that you could have written by hand. When you create an HTML file do you type the image data into it? Of course not. So your JSP can't do that either.
How do you reference an image in an HTML file? With a URL. So your JSP needs to do the same. Use a URL that references a servlet that serves the image data.
P.S. This question has been asked dozens of times in this forum. Please SearchFirst.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: Display image which is store in database
|
|
|