File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes <p:graphic image> in conjuction with <p:fileupload> Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "<p:graphic image> in conjuction with <p:fileupload>" Watch "<p:graphic image> in conjuction with <p:fileupload>" New topic

<p:graphic image> in conjuction with <p:fileupload>

Vladislav Simovic
Ranch Hand

Joined: Feb 03, 2011
Posts: 37
I ve been trying out fileupload and its working quite alright. However i ve written piece of code in fileuploadlistener thats not working quite alright. This is how my listenet looks like:

this is xhtml

However when i enter the new image via fileuploader nothing happens. Method enterImage is called, and all action are done, but image is not displayed on panel. What am I missing?
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Have you added the listener to web.xml? also include your enclosing <h:form ...> tag.
What versions are you using of everything etc.... put more thought into asking the
Claudionor Junior

Joined: Jun 07, 2011
Posts: 1
Hi. Have you solved your problem? I´m facing the same issue and can´t get a single solution.

I´m using a fileUpload and wanna show the image uploaded in a dataTable just after the upload event but the image doesn´t appear.

Oscar Barrofet

Joined: Sep 16, 2011
Posts: 1
just as it is mentioned in this forum.

1) you have to edit the web.xml to add the filter mapping for upload (as mentioned by brendan):

2) you need two dependencies added in the classpath of the project:

3) Also check you have server as STATE_SAVING_METHOD in web.xml

4) ! it's worth having a look to the prime faces user guide (the dependencies stuff is explained in page 12.,
I agree. Here's the link:
subject: <p:graphic image> in conjuction with <p:fileupload>
It's not a secret anymore!