spring boot - loading dynamic image from local source -
i have saved images local path of pc , saved file name db. want load image db , show html page using java script , thymemleaf. browser says not allowed load local resources , made servlet in spring boot. not showing image. servlet @webservlet("/admin/imgservlet") public class adminimageservlet extends httpservlet { private static final long serialversionuid = 1l; @override public void doget(httpservletrequest request, httpservletresponse response) throws ioexception { string urlimage = request.getparameter("admin"); response.setcontenttype("image/jpeg"); servletoutputstream out; out = response.getoutputstream(); fileinputstream fin = new fileinputstream("c:/users/public/documents/" + urlimage); bufferedinputstream bin = new bufferedinputstream(fin); bufferedoutputstream bout = new bufferedoutputstream(out); int ch = 0; while ((ch = bin.read()) != -1) {