4

I need to make a file upload function in JSF 2 so I was searching about it and found it is possible to do with Tomahawk, which I think is not very stable with JSF 2. I'm using RichFaces, so I look for it and found this which I think more simple, but I'm using richfaces 4.

So I wonder if there's a way to do this with richfaces 4 or do this with JSF 2 only.

Any idea, suggestion ?

Community
  • 1
  • 1
Valter Silva
  • 16,446
  • 52
  • 137
  • 218

1 Answers1

2

You're looking at RichFaces 3.3.x demo site. You need to look at RichFaces 4.x demo site. The <rich:fileUpload> demo page contains a concrete example with source code.

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

Using Tomahawk is only more easy. I'm not sure why you think that it's not very stable.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Hello my friend, sorry I think I made a misunderstanding about Tomahawk. At the end I prefer to use richfaces, which I was using already in my project =) . Thanks. – Valter Silva Nov 07 '11 at 21:07
  • Just for curious, what is your name ? It is really BalusC ?Or Balus ? (I'm asking here 'cause don't know other way to contact you).If you don't want to answer that's ok mate, I really enjoy all your teachings, really, thanks. – Valter Silva Nov 07 '11 at 21:09
  • My real name is Bauke. See also my [SO user profile](http://stackoverflow.com/users/157882/balusc) and several other places which I linked (in)directly in my SO user profile, such as my blog, Careers profile, Linkedin profile, etc. On the "frontpage" of [my blog](http://balusc.blogspot.com) you can find a little history of the nickname "BalusC". – BalusC Nov 07 '11 at 21:12
  • 1
    Nice to meet you my friend, Bauke. =) – Valter Silva Nov 08 '11 at 13:18