Springmvc 怎么从controller传图片给JSP显示 200
controller中的代码:BufferedImageimg1=null;BufferedImageimg2=null;if(student.getId_card_sc...
controller中的代码:
BufferedImage img1 = null;
BufferedImage img2 = null;
if(student.getId_card_scan()!= null | student.getDiploma_scan() != null)
{
ByteArrayInputStream in1 = new ByteArrayInputStream(student.getId_card_scan());
img1 = ImageIO.read(in1);
ByteArrayInputStream in2 = new ByteArrayInputStream(student.getDiploma_scan());
img2 = ImageIO.read(in2);
in1.close();
in2.close();
}
model.addAttribute("id_card_scan",img1);
model.addAttribute("diploma_scan",img2);
在JSP中要怎样才能把图片显示出来 展开
BufferedImage img1 = null;
BufferedImage img2 = null;
if(student.getId_card_scan()!= null | student.getDiploma_scan() != null)
{
ByteArrayInputStream in1 = new ByteArrayInputStream(student.getId_card_scan());
img1 = ImageIO.read(in1);
ByteArrayInputStream in2 = new ByteArrayInputStream(student.getDiploma_scan());
img2 = ImageIO.read(in2);
in1.close();
in2.close();
}
model.addAttribute("id_card_scan",img1);
model.addAttribute("diploma_scan",img2);
在JSP中要怎样才能把图片显示出来 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询