How to upload a file in RichFaces 4?

I need to make the file upload function in JSF 2, so I searched for it and found it can be done with Tomahawk, which I think is not very stable with JSF 2. I use RichFaces, so I search for it and find which I find simpler, but i am using richfaces 4.

So I'm wondering if there is a way to do this with richfaces 4 or do it only with JSF 2.

Any idea suggestion?

+4
source share
1 answer

You are viewing the demo site RichFaces 3.3.x. You need to see the RichFaces 4.x demo site . The demo page <rich:fileUpload> contains a concrete example with source code.

To do this with pure JSF2, you need to create a custom component and analyze multipart / form-data requests yourself. There's a blog about it with complete and specific examples: Uploading files using JSF 2.0 and Servlet 3.0 .

Using Tomahawk is only easier. I am not sure why you think that it is not very stable.

+2
source

Source: https://habr.com/ru/post/1379980/


All Articles