Search code examples
javarestjerseyjersey-client

Jersey should not consume any form parameter. exception


I am building rest webservice using jersey, when I add this function i got this exception, but when i remove it, the server works very good.

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.

the code is

@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";
    }

it is weird because I always use path like that path. i dont know what am i doing wrong


Solution

  • if you are using @FormParam. Also make sure INPUT HTML types are using name= not id=.