Hallo

I'm new to sling so I would welcome some feedback on my first patch.

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.

The following is a hello-world example service:

@Component
@Service(Object.class)
@Property(name="javax.ws.rs", boolValue=true)
@Path("testing/hello-world")
public class RootResource {

        @GET
        public String greeting() {
                return "hello world";
        }
        
        @GET
        @Path("bye")
        public String sayGoodBye(@QueryParam("name") String name) {
                return "Good Bye, "+name+".";
        }
}

By registering this class the uri--paths /testing/hello-world and
/testing/hello-world/bye are served using this root resource.

Because of the issue I described in SLING-2191 I couldn't yet add a
test to launchpad/integrations-tests.

Cheers,
Reto

Reply via email to