I've come up against a problem. i can't properly use BigDecimal
in my own class, to do post actions. hope for advice
Using Jersey 2.x, Jackson 1.8
my class
public final class TestModel{
private BigDecimal ffff;
public BigDecimal getFfff() {
return ffff;
}
public void setFfff(BigDecimal ffff) {
this.ffff = ffff;
}
public void setFfff(double ffff) {
this.ffff = new BigDecimal(ffff).setScale(2, RoundingMode.HALF_EVEN);
}
}
and trying to do simple post action
@POST
@Path("/test")
@Consumes(MediaType.APPLICATION_JSON)
public Response test(TestModel tt) {
log.entry();
log.info(tt);
log.exit();
return Response.status(201).entity("").build();
}
but in result i get
{ClientResponse{method=POST, uri=http://somehost:8080/test, status=400, reason=Bad Request}
Get methods working fine. If I try to make post for BigDecimal
that also works, problem came out when i try to put BigDecimal
in my own class and than try to do post with it