msf4j response image got Improperly closed variable

42 Views Asked by At

i use msf4j with mustache for my project service and get problem when returning an image (image/png) as a response entity. here the code:

String img = MustacheTemplateEngine.render('path/to/image.png',null);
return Response.ok().type(MediaType.valueOf("image/png")).entity(img).build();

I realize mustache render only return string so there is no way to get image object as response. Is there another way to make response as image/png?

0

There are 0 best solutions below