users@jersey.java.net

[Jersey] _at_FormDataParam gives Bad Request.

From: kavita <kavitapravindeshpande_at_gmail.com>
Date: Mon, 5 Dec 2011 23:37:55 -0800 (PST)

Hi,
I have a REST web service to which I am sending multipart form data. Since
Glassfish 3.1 uses jdk7, I had to change the @FormParam to @FormDataParam in
the webservice method signature. Doing this causes all the requests to my
web service ending up as Bad Request errors.
  I am using an ajax request to call the web service. This is the call:


>>>>>>>>>>>>>>>>
 var formdata = new FormData();
                formdata.append("purpose","new");
                formdata.append("filename",workbook);
                formdata.append("username","abc");
                formdata.append("password","abc");
                formdata.append("company","Third");
                
                 $.ajax({
                           url:'http://comp1:8080/RestWSGS/jersey/GetJson',
                            async: false,
                            data:formdata,
                           type: 'POST',
                           cache: false,
                            dataType: 'json',
                            contentType: "multipart/form-data",
                            processData: false,
                            success: function(data)
                            {
                                     myData=data;
                                     alert("myData" + myData);
                                  }
                });
>>>>>>>>>>>>>>>>>>>>>>>>

Please let me know how can I ask jersey to convert the FormData object to
the F_at_FormDataParam.

Thanks for any help you can provide!!
Kavita

--
View this message in context: http://jersey.576304.n2.nabble.com/FormDataParam-gives-Bad-Request-tp7065882p7065882.html
Sent from the Jersey mailing list archive at Nabble.com.