users@jersey.java.net

Re: [Jersey] Problems with Jersey and Multipart

From: Á. Eduardo García <egarcia_at_swissms.ch>
Date: Thu, 3 Dec 2009 07:28:12 -0800 (PST)

Ok, I've found the issue, and completely my fault.

My fields didn't have any name, but only ids. So nothing was being
sent, and the multipart header was half empty (Only First boundary was
sent, as I posted a while ago, but no "Encapsulated multipart part:")

Maybe Jersey should support sending this kind of forms, or at least,
degrade gracefully or throw an exception.

Anyway, lot of thanks for your time, Paul!!

On 3 Dec 2009, at 16:17, Paul Sandoz [via Jersey] wrote:

>
> On Dec 3, 2009, at 4:10 PM, Á. Eduardo García wrote:
>
> >
> > My version of Jersey is 1.1.4.1 and Glassfish b73.
> >
> > Right now I cannot create a test case, maybe in a few hours
> > (although my
> > HTML and java code couldn't be simpler, I'm using a plain form with
> > one
> > 'file' field and a class with a @Path and the @POST method I added
> > earlier).
> >
>
> OK. If you can send me (privately if you like) your HTML that would
> help me and i can easily create the server side.
>
>
> > Using FormDataMultiPart doesn't show any change. Using another
> > browser also
> > doesn't help. However, using @FormParam instead of @FormDataParam in
> > all
> > parameters, throws this on Glassfish log:
> >
> > SEVERE: The RuntimeException could not be mapped to a response, re-
> > throwing
> > to the HTTP container
> > com.sun.jersey.api.container.ContainerException:
> > javax.mail.MessagingException: Missing start boundary
> > at
> > com
> > .sun
> > .jersey
> > .server
> > .impl
> > .model
> > .method
> > .dispatch
> > .MultipartFormDispatchProvider
> > .processForm(MultipartFormDispatchProvider.java:91).
> > ...
> >
> > Tell me if that helps.
> >
>
> So when you do that you are using the deprecated multipart/form-data
> support. It seems to indicate an error in the information the client
> sends to the server.
>
> And what if you change your method signature to:
>
> onPost(FormDataMultiPart fdmp) { .... }
>
> ?
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>
>
> View message @ http://n2.nabble.com/Problems-with-Jersey-and-Multipart-tp4106038p4106625.html
> To unsubscribe from Re: Problems with Jersey and Multipart, click
> here.
>

Ángel Eduardo García Hernández
egarcia_at_swissms.ch





-- 
View this message in context: http://n2.nabble.com/Problems-with-Jersey-and-Multipart-tp4106038p4106683.html
Sent from the Jersey mailing list archive at Nabble.com.