This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
I am struck on a simple problem
I have to display an image from a database. I have successfully uploaded the image in database.
now for displaying image on JSP I have a servlet which is doing this work
This servlet is stored in src folder under package action. Actually I am using struts2 and i dont know how to display it using struts2.
So my servlet is like this
getImage functionality is like this
}
[/code]
On JSP my code is
on searching on net i found this also
i tried using both but I am unable to display the image
ekansh singh wrote:Actually I am using struts2 and i dont know how to display it using struts2.
This is irrelevant. Struts is just another MVC framework.
i tried using both but I am unable to display the image
Aside from a lot of logic faults and resource leaks I see two huge flaws: 1) you're calling super.doGet() in the servlet and 2) you're getting only the first 20000 bytes of an image and ignoring the rest in the DAO.