0

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:

  1. Upload PDF file.
  2. Convert it to "tif" file.
  3. 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.

rakeshG
  • 11
  • 2
  • Instead of passing the name of the file in server, you could pass the bytes of the file as shown here: https://stackoverflow.com/q/10510416/1065197 – Luiggi Mendoza Jan 29 '18 at 14:51
  • @BalusC thankyou for you inputs, I followed your blog exact same way as mentioned. Yet was unable to display image on jsp. Though I am using jboss server i was able to run imageServlet successfully without any errors. Initialized file path as follows "this.imagePath = "C:/RakeshG/OCR Files/tiff files/";" and html reference as "" Do i need to make changes in standalone/data directory and place my image files there? – rakeshG Jan 30 '18 at 13:35

0 Answers0