0

I want to get images I have saved into an absolute directory from p:graphicImage

I tested this solution (BalusC) :

but the image doesn't appears :

here is my xhtml code :

<h:form prependId="false" enctype="multipart/form-data">
    <p:fileUpload binding="#{upload}" mode="simple" id="monfileupload" 
                  value="#{articleMB.uploadedPicture}"/>
    <p:commandLink id="mylink" onclick="uploader();">
        <h:graphicImage id="monimage" value="/images/Chrysanthemum.jpg" 
                        height="64"  width="64" binding="#{image}" />
    </p:commandLink>
    <p:commandButton actionListener="#{articleMB.ajouter}" value="submit"
                     ajax="false" />
</h:form>

and here is the config of the tomcat (in server.xml) :

<Context docBase="C:/images_test" path="/images" />

and here is the directory : enter image description here

I don't know what is wrong

Community
  • 1
  • 1
atbegin-but
  • 263
  • 1
  • 8
  • 19

1 Answers1

0

Since you are using tomcat 7, usage of aliases attribute will help you.

<Context ... aliases="/images=c:\images_test\">

You may more on context parameters on attributes on http://tomcat.apache.org/tomcat-7.0-doc/config/context.html

Serkan Arıkuşu
  • 5,549
  • 5
  • 33
  • 50