bean which holds uploaded image can't be request scoped. Because requests of upload and next one which shows the uploaded image - uses different instances in that case. and second request instance has no image in property already.
Thanks for your quick reply, i would to talk about 2 things here...
1. I am using a4j:keepalive tag in the jsf page where i upload the image and display the same. The bean that is passed as an argument to the a4j:keepalive tag is the one which contains both the upload and paint methods.
2. If cannot achieve this with the bean in request scope can you please suggest me with a solution to my problem. I cannot keep my bean in session as it holds too much of data. (My application allows a school to add a student any i have to take the complete details of the student including his / her medical data, parent details, guardian details and student details with respect to school - along with the student photo. My problem is i cannot put all this data in session).