how to retrieve image from mysql database using java servlet and show it in HTML img tag? and also that ima tag should be placed inside a table definition ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
write a servlet, map it to a url like
showImage.html, pass the imagename as param<img src="showImage.html?filename=new.jpg">Then read the byte[] from file and write to response OutputStream in the servlet code.
response.getOutputStream().write(bytes);To get byte[] from file