數據庫有張指紋表專門用來保存指紋圖片(10個手指頭),現在想要在JSP頁面上顯示某個人的10個手指的指紋圖片。請教各位大神如何實現?
JSP頁面代碼:
<img src="personAction_showByID.action" title="tt" style="width: 500px; height: 700px;">
action中對應代碼
public String showByID(){
HttpServletRequest request=ServletActionContext.getRequest();
String personId=request.getParameter("personId");
Person person=personService.getPerson(personId);
byte[] photo=person.getImg();
try {
sout=ServletActionContext.getResponse().getOutputStream();
sout.write(photo);
sout.flush();
sout.close();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}