Hi there,

If you have just two levels of nesting for your branches, I suggest that you
register additional attachments covering all cases.

If you have potentially unlimited nesting, you need to handle this in your
resource. In order to have your URI template match several URI path
segments, you need to customize the matching mode for the URI variable:

Route myRoute =
/", MyLeafResoure.class);

However, I'm not sure how to achieve something equivalent with Spring
configuration. Let us know if you have trouble.

Best regards,
Jerome Louvel
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com

-----Message d'origine-----
De : webp...@tigris.org [mailto:webp...@tigris.org] 
Envoyé : mercredi 24 juin 2009 19:57
À : discuss@restlet.tigris.org
Objet : Nested resource routing

I want to be able to nest arbitrarily deep items in a hierarchical format,
and route them based on URI patterns in Spring.  For example, I can have
objects nested like:


However, the branches can alos be nested, like this:


I have my Spring application context set up like this to handle the root
instances of "branches":

<bean name="root" class="org.restlet.ext.spring.SpringRouter">
    <constructor-arg ref="application" />
    <property name="attachments">
            <entry key="/branches/{branch_id}"
            <entry key="/branches/{branch_id}/leaves/{leaf_id}/"
            <entry key="/branches/{branch_id}/buds/{bud_id}/"

<!--  Spring Application -->
<bean id="application" class="org.restlet.Application">
        <property name="name" value="exampleAPI"></property>

I would like to be able to build my URI patterns so that I can handle the
cases where the branches are nested.  Is this even possible?



Reply via email to