Affichage d'une image avec spring hibernate et jsp
bonjour,
j'ai un problème dans mon code jee (jsp) avec spring et hibernate je veux afficher une images partir de ma base de donnée dans une page JSP
Code:
1 2 3 4 5 6
| @RequestMapping(value="/photoEmp",produces=MediaType.IMAGE_JPEG_VALUE)
@ResponseBody
public byte[] photoCat(int identifiant)throws IOException{
Employe e=services.getEmployeById(identifiant);
return IOUtils.toByteArray(new ByteArrayInputStream(e.getPhoto()));
} |
dans ma page jsp j'ai écrit
Code:
<td><img src="photoEmp.aspx?identifiant=${o.identifiant}"></td>
mon problème dans produces=MediaType.IMAGE_JPEG_VALUE il m'affiche cette erreur:
Citation:
Multiple markers at this line
- MediaType cannot be resolved to a variable
- The attribute produces is undefined for the annotation type
merci d'avance.