How to serialize Java primitives using Jersey REST

Posted by Olvagor on Stack Overflow See other posts from Stack Overflow or by Olvagor
Published on 2010-04-13T12:40:11Z Indexed on 2010/04/13 12:42 UTC
Read the original article Hit count: 335

Filed under:
|
|
|
|

In my application I use Jersey REST to serialize complex objects. This works quite fine. But there are a few method which simply return an int or boolean.

Jersey can't handle primitive types (to my knowledge), probably because they're no annotated and Jersey has no default annotation for them. I worked around that by creating complex types like a RestBoolean or RestInteger, which simply hold an int or boolean value and have the appropriate annotations.

Isn't there an easier way than writing these container objects?

© Stack Overflow or respective owner

Related posts about java

Related posts about primitives