jersey - Jeresy Jackson BigDecimal Post -


I've come up against a problem. I can not use BigDecimal in my own class, jersey 2.x, jackson 1.8

my class

 < Code> Public Ultimate Category TestDodel [Private Bugfile FFF; Public Baddickle getFfff () {Return FFF; } Public Zero Setsf (BigDQmailFFF) {this.ffff = ffff; } Public Zero Setsf (Double FFFF) {this.ffff = New Bidikimil (FFFF) .setScale (2, Rounding Mode.HF_avn); }}  

and is trying to take simple post action.

 @ code @ path ("/ test") @ Consum (MediaType.APILICATION_JSON) Public Response Test (TESTODODEL TT) {log. Anti (); Log.info (tt); Log.exit (); Return Response.States (201) .INT (""). Build (); }  

But as a result I get {ClientResponse {method = POST, uri = http: // somehost: 8080 / test, status = 400, reason = incorrect request}

Methods work fine. If I try to post to BigDecimal , then the problem arises when I try to enter BigDecimal in my square and try to post it with No problem

The problem is resolved. The problem was that, I have 2 setter methods, and when I am doing Post Action Jackson then there is a disorder in the BigDiQ, but trying to use the setter for the double. The solution is to tap the name of the setter or to use the deserilization of its own.

Public class testdeser JsonDeserializer expansion & lt; Double & gt; {@ Override Public Double Dissitrise (JSnPersoner JP, Decierilization Contact DC) throws IOException, Jason processing expedition {return jp.getDoubleValue (); }

and

  @JasonDisyrailise (= using testDeser.class) in the model class Cheat) {This.cheat = New BigDial (Cheat) .setScale (2, Rounding Mode.HF_avn); }  

but I do not know which solution is better.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -