users@jersey.java.net

Re: [Jersey] need help with parsing multipart/form-data input ( NullPointerException in 1.0.1-SNAPSHOT )

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 07 Nov 2008 18:18:42 +0100

On Nov 7, 2008, at 6:01 PM, Paul Sandoz wrote:

> Hi,
>
> Switching over to the users list as that is where all the action
> happens.
>
> As a work around change the following:
>
> @FormParam( "protocol" ) int protocol
>
> to
>
> @FormParam( "protocol" ) String protocol
>
> The problem is that when the "multipart/form-data" media type is
> used the registered message body readers are utilized and by default
> there are none capable of reading bytes to Java primitive types.
>
>
> I am working on a fix so that if a message body reader is not found
> the following happens:
>
> 1) create an "extractor" following the rules of @*Param; and
>
> 2) if an extractor in 1) exists apply that to the UTF-8 decoded
> String of the body part.
>

Fixed in the trunk.

Paul.