0

I am performing an AJAX request this way

 $.ajax({
            type: 'GET',
            url: 'http://hosti[:8080/OrderSnacks/oms/toppings?topping=' + id_attr_val,
            jsonpCallback: 'jsonCallback',
            cache: true,
            dataType: 'jsonp',

            jsonp: false,
            success: function (response) {
             console.log(response);
            },
            error: function (e) {
                $("#divResult").html("WebSerivce unreachable");
            }
        });
});

Inside my REST service call , i am unable to receive this parameter

@Path("/toppings")
public class ToppingService {
    @GET
    @Consumes("application/text")
    @Produces("application/json")
    public String getData(@PathParam("toppingid") String toppingid) {
        return "";
    }

I have tried all the options that is

public String getData(@QueryParam("toppingid") String toppingid) {
}

public String getData(@PathParam("toppingid") String toppingid) {

}

But nothing is working .

Could you please tell me how to receive those parameters ??

Mandar Pandit
  • 2,171
  • 5
  • 36
  • 58
Pawan
  • 31,545
  • 102
  • 256
  • 434

1 Answers1

2

You have a problem : you send topping but you ask for toppingid.

Ioan
  • 5,152
  • 3
  • 31
  • 50