0

how to pass a BigDecimal value in pathparam in browser URL?

    @GET
    @Path("helloxyz/{par1}/{par2}")
    @Produces{MediaType.APPLICATION_JSON)
    public  helloxyz(@PathParam("par1") BigDecimal par1,@PathParam("par2") BigDecimal par2){

    BigDecimal result = par1.divide(par2)

    return result;

    }

}

I am receiving error like can't extract parameter from http request.

when I pass values like this.

http://xxlocalhostaddressxx/rest/app/helloxyz/{"par1" : 1.2}/{"par2" : 1.2}/

However, everything works file for @PathParamtype String. only happens in the case of non String type @PathParam

yeppe
  • 679
  • 1
  • 11
  • 43

0 Answers0