On Tue, Nov 6, 2012 at 6:24 PM, Edward Burns <edward.burns_at_oracle.com>wrote:
> >>>>> On Mon, 5 Nov 2012 10:37:02 +0100, Werner Punz <
> werner.punz_at_gmail.com> said:
>
> WP> Hi Ed here is a small comment on the jsdocs in conjunction with the
> file
> WP> uploads:
>
> WP> Normal Ajax Part:
> WP> Set the request header with the name: Faces-Request and the value:
> WP> partial/ajax.
>
> WP> That is not possible in case of the iframe request because we cannot
> WP> set request headers. with iframe requests, we need another marker
> WP> here for the server to identify that this is an ajax request coming
> WP> in.
>
> WP> Normally the parameter javax.faces.partial.ajax true Should be
> WP> enough to identify that the request is an ajax request in that
> WP> case. But the sentence "*but the request must be sent with all the
> WP> parameters that a JSF XMLHttpRequest would have been sent with*"
> WP> cannot hold up entirely due to the limitations of the iframe method
> WP> regarding header parameters.
>
> We already require javax.faces.partial.ajax true is sent. The reason we
> use the header approach in the first place can be seen from this mail
> from Jim Driscoll from 2008:
>
> >>>>> On Tue, 16 Dec 2008 17:44:54 -0500, Jim Driscoll said:
>
> JD> Changed the PartialViewContext to use Headers, rather than parameters,
> JD> since isAjax is getting called before the view is initialized. That
> JD> means that we can't access Params, since that prevents setting the
> JD> character encoding on the request when the view is initialized.
>
> I would think this restriction would also be present when sending an
> "ajax" request with the hidden inline frame. Is there some other way
> the server can detect the inline frame case so that it can treat it as
> "ajax"?
>
> To my knowledge the iframe method has the limitations of a normal form post
hence you cannot tamper with the request header, the only way out of it is
not to use
iframes but xhr level2 elements for the multipart upload.
But those are only supported in new browsers (aka even IE9 is not
supporting it ie10 does however)
and also xhr level2 still is a w3c working draft.
Werner