users@jersey.java.net

[Jersey] Re: _at_FormDataParam gives Bad Request.

From: kavita <kavitapravindeshpande_at_gmail.com>
Date: Wed, 7 Dec 2011 20:18:05 -0800 (PST)

eh? Glassfish 3.1 can run on jdk 1.6, not sure about 1.7 but I guess it
should run.. anyway, that sentence doesn't make much sense. @FormParam
is present in JAX-RS 1.x API so you don't need to replace it with
anything, it is just there and it should work.
>> Actually I have upgraded to java 7. I was using 1.6 update 7 which needed
>> to be at least update 22. If i use @FormParam with jdk 1.7 it gives the
>> error that @FormParam cannot be used for multipart/formdata. Nevertheless
>> I will download the 22 update and use it with glassfish 3.1. Still I dont
>> know what must be used for sending the request in case someone uses
>> @FormDataParam!!!


  can you please look into server log (and let us know what you found
there)? And is it possible for you to share service code as well?
>> Sure this is the signature of the method:
@POST
        @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
        @Consumes(MediaType.MULTIPART_FORM_DATA)
        public Exceldatalist getJson(@FormParam("purpose") String purpose,
                                                                                @FormDataParam("filename") String wbkname,
                                                                                @FormDataParam("username") String username,
                                                                                @FormDataParam("password") String pwd,
                                                                                @FormDataParam("company") String company)
        {
                System.out.println("Purpose: "+purpose);
                System.out.println("wbkname: "+wbkname);
                System.out.println("username: "+username);
                System.out.println("pwd: "+pwd);
                System.out.println("company: "+company);
.
.
.
.
.
        }

I've already said that the multipart jars loading which used to come on
server.log whenever deploying such web services, does not come now with
glassfish 3.1. But I can see the jars in the buildpath. jersey multipart 1.4
is on the buildpath.

I am getting a bad request resonse. I have given the log trace already.
Please help me with this...
Kavita
    

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