What exactly @produce does . does it converts the java object to JSON response .If we configure @produce mediaType--> JSON
posted 3 years ago
When constructing the response body Jersey internally tries to find a MessageBodyWriter that can turn Item objects into xml/json. Usually the programmer supplies these 'mapper' classes, but for XML and JSON Jersey has built in MessageBodyReaders already for convenience.
That is why it appears as if there was going on some magic.