I\'m developing a web app where i have a form like that
Just to keep it simple: in case it is the only request handler mapped to the specific URL (in that case "test") and with the specific HTTP method (POST), you can avoid the usage of @Consumes!
try this:
@Path("test")
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
public String testForm(@FormParam("accept") String accept) {
return accept;
}
Multipart is something slightly different, see jersey sample multipart-webapp or see http://www.w3.org/Protocols/rfc1341/7_2_Multipart.html. Your web form is not producing it, so Jersey correctly returns 415 - Unsupported media type, because you don't have any resource which is handling "application/x-www-form-urlencoded" media type.