On Mon, Aug 22, 2011 at 4:00 PM, Bertrand Delacretaz
<[email protected]> wrote:
> Hi Reto,
>
> On Mon, Aug 22, 2011 at 11:03 AM, Reto Bachmann-Gmür <[email protected]> wrote:
>> ...As Sling is (also) about supporting the development of RESTfull
>> web-application is seems natural to support the JAX-RS standard.
>> Apache Clerezza show how this can be integrated quite nicely with he
>> osgi white-board pattern. The proposed patch for SLING-2192 does not
>> use any code from Clerezza but bases on the latest release of Apache
>> Wink, by following the same service-selection convention as Clerezza
>> the implementation is however compatible....
>
> Cool stuff...IIRC we already had some plans to include jax-rs support
> in Sling, and it certainly makes sense.
>
> I'd prefer to have this as an optional extension however, i.e. under
> contrib, as people should use Sling's resource-based script/servlet
> selection instead of relying mostly on paths as jax-rs does. Having
> that option is fine, but not by default IMO, so that to keep the focus
> on what we consider the normal way of doing things.
The next step is to add support for type-bound resource classes. Like
for scripts and servlets it should be possible to bind jax-rs classes
to both path and type.

The Jax-Rs standard defines a powerful and convenient way to write
classes providing rest resources. Compared to servlets, this standard
can offer a simpler and more elegant way to write such application.
The choice is not an exclusive one, it is perfectly possible to mix
both development styles. The only little compatibility issue is that
jax-rs support regex-path matching while sling doesn't, that's why I
had to resort to the OptingServlet.

>
> Also, considering SLING-2191 and the related thread from a few minutes
> ago, it might be better to mount the JaxRsServlet on a path (/jaxrs by
> default maybe?) rather than by resource type, to avoid two resolution
> mechanisms fighting for the same URL space.

Implementation details shouldn't affect the URI, it should be possible
to port the same service from script to servet or jax-rs (with the
extension to bind to sling:types).

Reto

>
> Opinions?
>
> -Bertrand
>

Reply via email to