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
Use @QueryParam
with @GET
and @FormParam
with @POST
Not sure what you got fixed from the approved answer, but since I'm not seeing the answer FYI you should use @PathParam to capture path segments (not @FormParam which is to capture POST data)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With