My Question is simple. I want to upload the file (not the external location) within the server; say in WEB-INF/files (if it's a good idea. So far I have uploaded the file to the external location but the problem is I can not display the file (image) back to the details.xml
Here is my code:
image upload and saving the location to Database via Hibernate(not concerned here).
<h:form enctype="multipart/form-data">
<h:panelGrid columns="1">
<h:panelGroup>
<p:fileUpload fileLimit="1" auto="true" fileUploadListener="#{employeeManagedBean.upload}" allowTypes="/(\.|\/)(gif|jpe?g|png)$/" sizeLimit="100000" description="Upload Image" required="true" />
</h:panelGroup>
</h:panelGrid>
</h:form>
and here is the snippet from details.xml which should have shown the picture (but doesn't, although the link to that image shown in the rendered page is correct).
<h:graphicImage value="#{employeeManagedBean.image}"/>
Where am I messing up. I am newbie!