I am developing a web app on JBOSS AS 7 using Richaces 4, SEAM and JPA. I can not get rich:fileUpload working. I have no idea how to make it. When uploading image through rich:fileUpload, I need it to be inserted into the database. What I did right now:
- I have an .xhtml page where there is a form for Uploading files (used one from Richfaces demo);
- Created an entity bean UploadedImage.java (with @Lob annotation for image column);
- DAO class to persist uploadedimage using entitymanager;
- And UploadBean.java for view to connect it with EJB project;
If anyone will have the same issue, here is how to get it working:
Upload.xhtml (contains form for image upload):
FileUploadBean.java (delivering data to ejb class):
EJB class:
UploadedImage.java (entity bean):