Question subject: Display images on jsp from servlet
Posted: Mon Jun 29, 2009 6:12 pm
Joined: Mon Jun 29, 2009 5:56 pm Posts: 4 Has thanked: 0 time Have thanks: 0 time
Hello, I am peggie. Currently, I am trying how to display image from the database(mysqlquerybrowser) through the use of servlet. However ,I do not know the codes to be put in jsp in order to call out the image from the servelet as well as the database.
Could you guys help me check my servlet and java class to see whether if there is any mistake. As well as how to call out the images and display in jsp page:)
public class Image { int imageID; Byte image; String imglen; public int getImageID() { return imageID; } public void setImageID(int imageID) { this.imageID = imageID; } public Byte getImage() { return image; } public void setImage(Byte image) { this.image = image; } public String getImglen() { return imglen; } public void setImglen(String imgLen) { this.imglen = imgLen; }
}
My database in mysql query browser is called images And the attributes are: int imageID Blob image Thanks:D Hope to receive u guys reply soon!:D
msi_333
Question subject: Re: Display images on jsp from servlet
Posted: Mon Jun 29, 2009 10:00 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2103 Location: Earth Has thanked: 39 time Have thanks: 57 time
I never tried try to use BLOb for image before , what i used is just to save image as file and use the id to create its file path and put it in <img > tag src .
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )