On Apr 17, 2012, at 5:11 AM, rsigal_at_redhat.com wrote:
> Just to add to the chorus, I'd like to be able to do something like
> this:
>
> @Path("/")
> public static class TestResourceWithSubLocator
> {
> @Context AnnotationProcessor processsor; // <-- here
>
> @Path("subresource")
> public TestSubResource property()
> {
> TestSubResource tsr = new TestSubResource();
> processor.injectAndValidateEveryDamnThing(tsr); // <--
> and here
> return tsr;
> }
> }
>
> @Path("/{s}")
> public static class TestSubResource
> {
> private String s;
>
> @QueryParam("t")
> @Size(min=2, max=4)
> private String t;
>
> @Size(min=2, max=4)
> public String getS()
> {
> return s;
> }
>
> public void setS(@PathParam("s") String s)
> {
> this.s = s;
> }
>
> ...
> }
>
> It's just a shame to have all that code implemented in the JAX-RS
> provider but make the user do it all over again.
I agree. We are looking into ways how to fix it. Stay tuned.
>
> By the way, this is a minor point, but I noticed that Section 1.5
> "Terminology" and Section 3.4.1 "Sub Resources" define "sub-resource
> methods" and "sub-resource locators" but don't actually define
> "sub-resources". It seems like a concept worthy of a definition.
>
Please, file a new issue against the spec.
Thanks,
Marek
> -Ron