Thanks in advance for your inputs, I am editing same question as solution provided by @BalusC results in servlet serving image file as downloadable link which i am able to do thanks to @BalusC, What I need is, to display this image in section of JSP.
I understand there are similar question available but in my case I need to:
- Upload PDF file.
- Convert it to "tif" file.
- Display converted tiff file in jsp with highlighted text.(Display image in jsp along with other UI, rather create a "download link" or "click to view link")
I completed first 2 points along with highlighting of texts in image. Now i am unable to display newly created tiff file in jsp as follows
<img src="<%=request.getAttribute("tifPathName")%>"/>
also tried with
<embed id = 'tif' src="<%=request.getAttribute("tifPathName")%>" width="800px" height="2100px">
</embed>
I tried placing newly created tiff files in both locations i.e /WebContent/tiff/
folders as well as in File system C:/<filepath>
.
From all previous answers what I is understood is we can create a imageServlet pass the url in <img src="sevletContext/ActionName/">
this will result in display of image. This is not solving my purpose.
Per my requirement user should nowhere be involved from upload till display of image, hence reducing multiple clicks by user.