1
나는 이미지를 데이터베이스에 저장했으며 나머지는 노출시키고 싶다. 가장 좋은 방법은 무엇입니까?rest-to-image-bytes
@Path("/image/{imageId}.jpeg")
@Stateless
@Produces({"image/jpeg"})
public class ImageSource{
@PersistenceContext
EntityManager em;
@GET
public /* what */ getImage(@PathParam("imageId") Long imageId) throws IOException{
byte[] image = em.find(Entity1.class, imageId).getImage();
// something here
}
}