Public String getImgFromByte (){
// Obtain the byte [] data of the Image Based on the business logic
.......
InputStream buffin = new ByteArrayInputStream (/* byte [] Data */);
String str = picUrl. getImageType ();
String imgtype [] = str. split ("/");
BufferedImage img;
Try {
Img = ImageIO. read (buffin );
// Disable image caching.
This. getResponse (). setHeader ("Pragma", "no-cache ");
This. getResponse (). setHeader ("Cache-Control", "no-cache ");
This. getResponse (). setDateHeader ("Expires", 0 );
This. getResponse (). setContentType (picUrl. getImageType ());
// Output the image to the Servlet output stream.
ServletOutputStream sos;
Sos = this. getResponse (). getOutputStream ();
ImageIO. write (img, imgtype [1], sos );
Sos. close ();
} Catch (IOException e ){
// TODO Auto-generated catch block
E. printStackTrace ();
}
Return null;
}
Jsp page
</span>
For struts. xml, you only need to configure acton jump.