java - CXF JAX-RS Client - Avoiding the need to override toString of POJOs -


i'm calling following method jax-rs client.

@post @consumes("application/json") @produces("application/json") public book createbook(book b); 

it typically calls b.tostring() marshall it. assuming not have control on class book (it has it's own tostring()), there way can tell client use particular library/factory/something else marshal object json instead of calling tostring()?

thanks!

are using jackson? if not, @ it: cxf jackson

since createbook declared return string, if try return it, use tostring.

i'm wondering why don't return book if that's what's coming out. return response methods , build response. may overkill in case.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -