views:

541

answers:

2

One serious restriction is that I can't use Tomahawk or RichFaces or anything else.

+1  A: 

Apache-Commons provides an implementation of FileUpload for use in servlets conforming to JSR 53. http://commons.apache.org/

stacker
Jsf still runs on the JSP/Servlet specifications. So using a servlet method is perfectly fine, like the apache commons file uploader component.
+1  A: 

If you're already on JSF 2.0 and Servlet 3.0, then you can create a custom component for that based on the plain vanilla Servlet 3.0 API: Uploading files with JSF 2.0 on Servlet 3.0.

If you're still on Servlet 2.5 or older, then you need to do more work. Tomahawk has done perfect work with that, so I really don't see any reason why you don't want to make use of it. If the actual problem is that you can't get it to work at all or have somehow an aversion against "3rd party component libraries", then just don't try it the hard way. Using Tomahawk is pretty easy: Uploading files with JSF.

BalusC