Werner Punz schrieb:
The problem with input file is that JSF2 spec simply does not support it
at all yet
I have basically brought this up a number of times within the JSF2 ml
(and I assume there has been a bug filed for it)
if you want file upload you have to bypass the JSF2 ajax api, sadly as
it is. We (Ganesh, Alex and I) made preparations for the integration of
such a layer by modularizing the entire codebase as much as possible so
that you will be able to switch transports on the fly (the hook point is
our impl class where you can change the request object)
But in the end this needs to be solved on spec level :-(. In my opinion
this is a huge gap in the spec which should have been covered upfront,
but there were two reason for doing it as far as I could get it right.
First they wanted to get the ajax part right before extending it,
secondly multipart form request soon will be first class citizen of
of the JEE spec which it has not been up until now.
Sorry to say all this, but the matter of multipart request is somewhat
something which leaves a lot of bitter taste in my mouth :-)
Ok I shot over the top a little bit early, the problem with file input
is that you cannot cover it within the bounds of XHR at all you have to
revert to an iframe transport. The problem in the spec however is that
it basically for now binds the transport to an xhr layer, which in
itself contractics the mechanisms which have to be applied to get an
ajaxed file upload. All I can say is if it is multipart form request
bypass the spec and use your own solution for now especially if you have
to cover both APIs. Nothing prevents you from doing that, and I assume
that is what everybody will do for file uploading.
Werner