Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @RequestMapping(value="/images",method = RequestMethod.GET)
- public @ResponseBody void affichimage(@RequestParam("id") Integer Iddd,HttpServletResponse response,HttpServletRequest request) throws IOException
- {
- Annonce annonce=new Annonce();
- annonce=annoncedao.findOne(Iddd); // get the right annonce from
- //database
- File imageFile = new File(annonce.getimage()); // in image I have
- //the link to images ex : E:/images/image1.jpeg
- response.setContentType("image/jpeg");
- BufferedImage image = ImageIO.read(imageFile);
- ImageIO.write(image, "image/jpeg", response.getOutputStream());
- }
- < img class="imagesaffichage" src="/images?id=${annonce.id}" alt="No image"/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement