Jersey should not use any form parameter. an exception

I create a rest webservice using jerseys, when I add this function, I got this exception, but when I delete it, the server works very well.

Customer.orderWeb(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String), should not consume any form parameter. 

code

 @Path("orderWeb/{customerID}/{restaurantID}/{IDs}/{numbers}/{descriptions}/{addressID}") @GET @Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.TEXT_HTML, MediaType.TEXT_XML }) @Consumes({ MediaType.TEXT_PLAIN, MediaType.TEXT_PLAIN, MediaType.TEXT_PLAIN }) public String orderWeb(@FormParam("customerID") String customerID, @FormParam("restaurantID") String restaurantID, @FormParam("IDs") String IDs, @FormParam("numbers") String numbers, @FormParam("descriptions") String descriptions, @FormParam("addressID") String customerAddress) { return "WSSSSSSSSSSSSSSSSSS"; } 

This is strange because I always use a path similar to this path. i don't know what i am doing wrong

+4
source share
3 answers

if you use @FormParam. Also make sure that the HTML INPUT types use name = not id =.

+1
source

Use @QueryParam with @GET and @FormParam with @POST

+16
source

Not sure what you fixed from the approved answer, but since I don't see the FYI answer, you should use @PathParam to capture the path segments (not @FormParam, which should write POST data).

+2
source

Source: https://habr.com/ru/post/1486406/


All Articles