1

In my project i create images and put them in a directory by :

 // Save process diagram to a file
            InputStream processDiagram = repositoryService.getProcessDiagram(processInstance.getProcessDefinitionId());
            try {
                FileUtils.copyInputStreamToFile(processDiagram, new File("/home/ilyass/selectSystemWorkspace/Core/selectsystem-view/src/main/webapp/images/workflow/Process11.png"));            
            } catch (IOException e) {
                e.printStackTrace();    
            }

now i want to display it in my xhtml page using :

        <h:graphicImage value="/images/workflow/Process11.png" />

the problem is without refreshing the directory i can't retrieve the image ! i tried to add this line to my tomcat server.xml based on a solution found here : Load images from outside of webapps / webcontext / deploy folder using or tag

     <Context docBase="/home/ilyass/selectSystemWorkspace/workflow/" path="/workflow" />

But still the same since i'm creating the images inside the project and put them into the folder, any ideas how to solve that

Elias
  • 89
  • 10
  • i'm not using any db here ! i'm just creating an image puting it in PATH and then trying to display it in a JSF page – Elias May 25 '17 at 14:55
  • What you need is to refresh view (The graphic image) when image is saved refer to this answer https://stackoverflow.com/a/11367277/1460591 – Youans May 25 '17 at 15:26
  • Isn't this a tomcat specific issue? And isn't the same a problem when using a plain html `img src=...` tag? – Kukeltje May 26 '17 at 07:21
  • yes it's a server issue but not only tomcat , since i'm creating the images means that they're not presented to the server on first run . the image is set at the right path but only displayed in xhtml page after i refresh the directory where images are set – Elias May 26 '17 at 08:59

0 Answers0