I don't think you'll have any success there. The upload and display are going to be in 2 separate HTTP requests, and unless you intend to keep the image in a session object, you'll need a persistent place to store it.
In
J2EE, the server co-opts the java.io.File tempfile functions to permit the creation of temporary files in a place that's convenient to the J2EE server. You don't need to know its actual filesystem location as long as you use the tempfile API functions.
So what I normally do is stream the uploaded data into a temporary file, store its location in the session, provide a mechanism where a request for that image is then output and delete the file when no longer needed.
I haven't worked with PrimeFaces recently, but I seem to recall that RichFaces file upload included a means of displaying post-upload thumbnails with relatively minor pain, so you might want to double-check the Primefaces docs.