Paul,
Appreciate the prompt reply. The switch to the String type fixed the issue. Will you be uploading a new snapshot soon with your fix? Also, would it also better report a type mis-match such as this?
Thanks,
-Moiz
----------------------------------------
From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Sent: Friday, November 07, 2008 9:27 AM
To: users_at_jersey.dev.java.net
Subject: Re: [Jersey] need help with parsing multipart/form-data input ( NullPointerException in 1.0.1-SNAPSHOT )
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.