otto-de/jsonhome — pull request #51 by SebastianSchroeder (2012-12-15 16:29:08+00:00)
Title: Jersey support

Hello,

here is the branch with jax-rs support. The example app hellojersey shows how to use it.

A jsonhome.properties file is expected to be in the package de.otto.jsonhome with the properties "applicationBaseUri", "relationTypeBaseUri" and "resource.packages". The last property tells the library in what packages to search for jax-rs resources.

When using Spring the properties may be injected and no properties file is necessary.

A problem that is caused by the request scope of jersey resources is that every time the json-home document is called the class path is scanned for jersey resources. Since the jsonhome documents are cached for an hour this should not be a big problem. When using Spring the resource scope can be set to application thus eliminating the problem.

Please let me know what you think.

Cheers,
Sebastian