myHomeList.drawio.png

controller

 	@RequestMapping(value = "/myHomeCoverImages.do", method = RequestMethod.GET)
 	public void myHomeCoverImages(@RequestParam("articleNo") int articleNo, @RequestParam("image") String image,
 									HttpServletRequest requ, HttpServletResponse resp) throws Exception {
 	    OutputStream out = resp.getOutputStream();
 		
 		String filePath = "C:\\\\gami\\\\board\\\\board_myhome\\\\coverImage\\\\" + articleNo + "\\\\" + image;
 		File image1 = new File(filePath);

 		if (image1.exists()) {
 			// of : 경로, size : 출력크기, outputFormat : 출력포멧(.png), toOutputStream : 출력
 			Thumbnails.of(image1).scale(1).outputFormat("png").toOutputStream(out); // Thumbnails 라이브러리
 		}
 		byte[] buffer = new byte[1024 * 8];
 		out.write(buffer);
 		out.close();
 	}

myHomeList.jsp - Thumbnails

<div class="thumbnail">
<c:choose>
 <c:when test="${not empty article.boardMyhomeArticleNo}"> 
   <a href="${contextPath }/board/board_myhome/viewCount.do?boardMyhomeArticleNo=${article.boardMyhomeArticleNo}">                                                            
	 <img src="${contextPath}/board/board_myhome/myHomeCoverImages.do?articleNo=${article.boardMyhomeArticleNo}&image=${article.imageFileName}" alt="커버 이미지">						       
	</c:when>
<c:otherwise>(이미지 없음)</c:otherwise>
</c:choose>
</div>