jax rs - Why do we need JAXB bean when configuring JSON for RESTful web services? -


i'm reading tutorial configuring json restful web services: https://blogs.oracle.com/enterprisetechtips/entry/configuring_json_for_restful_web

jaxb defines how java objects converted , xml.

however don't understand why have jaxb bean model when creating restful web services return json response? after json not xml, right?

however don't understand why have jaxb bean model when creating restful web services return json response?

short answer

you don't have use jaxb create restful service using jax-rs framework. jax-rs provides messagebodyreader/messagebodywriter mechanism plug-in whatever binding want. json binding providers include implementation of these classes can use directly. below example of how eclipselink moxy (i'm tech lead):

advantage of using jaxb

applying jaxb mapping provides easy mechanism provide 1 set of mappings both xml , json representation of data.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -