Using Jersey to read form data

I'm developing a web app where i have a form like that

<form name="form" action="create-user" method="post">
   <input name="accept" type="checkbox"><span>{{acceptLegalTerms}}</span><br>
   <input type="submit" value="{{Continue}}" class="primary fright"/>
</form>

On the server side, We're using Jersey (on GAE). And here's what I'm trying to use to read the POST values

@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Path("create-user")
public Response createUser(@FormDataParam("accept") boolean acceptForm) {
   return Response.ok().entity(acceptForm).build();
}

But it doesn't work... It returns me...

HTTP ERROR 415

Problem accessing /login/create-user. Reason:

Unsupported Media Type

Any ideas? What Am I doing wrong?

Thanks!

6
задан Javier Manzano 20 February 2012 в 09:04
поделиться