webtier@glassfish.java.net

ServletFilter and AjaxRequest

From: Lyn Büsching <buesching_at_lat-lon.de>
Date: Tue, 19 Oct 2010 13:30:42 +0200

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I have a problem with a component uploading a file input written by my own.
First the request will be parsed by a ServletFilter if it has a multipart content.
In case the form will be send by using the ajax mechanism the form does not have
the original contenttype I entered in the form element:

<h:form id="form" enctype="multipart/form-data">...

In the jsf javascript file the request header is set as follows:

if (typeof req.xmlReq.setRequestHeader !== 'undefined') {
        req.xmlReq.setRequestHeader('Faces-Request', 'partial/ajax');
        req.xmlReq.setRequestHeader('Content-type',
'application/x-www-form-urlencoded');
}

Can I adapt them as I need? Am I missing anything?

Lyn


- --
l a t / l o n GmbH
Aennchenstrasse 19 53177 Bonn, Germany
phone ++49 +228 18496-0 fax ++49 +228 18496-29
http://www.lat-lon.de http://www.deegree.org

* * * * * * * * * * * * * * * * * * * * * * * * * * * *
                    deegree day 2010
             http://deegreeday.deegree.org
* * * * * * * * * * * * * * * * * * * * * * * * * * * *

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAky9gWEACgkQ/QSXMw31ZSuIVgCfTYVzuzXUZX4k9QDeL30sdrPO
Nr8An3Q/3bRcevC1cfbgxfH2quDTXV9u
=Scxh
-----END PGP SIGNATURE-----