John Doe
John Doe

Reputation: 166

How to upload file with jsf?

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

Upvotes: 3

Views: 7676

Answers (2)

BalusC
BalusC

Reputation: 1109874

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.

Upvotes: 2

stacker
stacker

Reputation: 69002

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

Upvotes: 2

Related Questions