Skip to main content

Mike Miller: Creating a simple JAX-RS MessageBodyWriter

JAX-RS is really cool and with the help of JAXB a lot of response data types can be converted for you simply by adding annotating the data objects with JAXB annotations. I am fairly new at JAXB but some simple cut/paste of annotations will take you a long way. There maybe some types of data that you can't or won't annotate for the purposes of returning that data type from a JAX-RS resource method. One simple example is returning either a boolean (primitive) or the wrapper Boolean class...