1

i have a link image saved on String Value in database ,and the image is uploaded in a folder on my localDisk( WEB-INF\images\form.png).

this is the folder link on the string value in database:

C:\projet\src\main\webapp\WEB-INF\images\form.png

this link is saved here :

 @Column(name = "Logo")
    private String link_logo;

and this is the Graphicimage in view.xhtml:

  <p:column headerText="LOGO" width="10%">
                 <p:graphicImage value="#{bean.link_logo}"/> 
                </p:column>

thank you so much.

Jasper de Vries
  • 19,370
  • 6
  • 64
  • 102
laziale8
  • 39
  • 5
  • 2
    Your first mistake is that you saved it in deploy folder, against the advice in https://stackoverflow.com/a/18664715 which was shown to you in all your previous questions. Fix that as soon as possible. And then just save the file name `form.png` in DB, not the full path as that makes no sense. Then pick one of the options in the answer of the abovelinked duplicate https://stackoverflow.com/q/4543936 in order to serve it back to the client. – BalusC Oct 02 '19 at 11:29
  • thank you so much Balus , i forget this link :https://www.programcreek.com/java-api-examples/?class=org.primefaces.model.UploadedFile&method=getFileName and its resolved now – laziale8 Oct 02 '19 at 16:01

0 Answers0