restlet / restlet-framework-java

The first REST API framework for Java
https://restlet.talend.com
648 stars 284 forks source link

SpringBeanRouter and bean aliases #1138

Open dscoppelletti opened 9 years ago

dscoppelletti commented 9 years ago

The SpringBeanRouter component attaches each bean to one and only one URI, though more than one aliases can be an URI. I wish the following bean was attached to both /rest/job and rest/job/{jobId} URIs:

<bean name="/rest/job;/rest/job/{jobId}" scope="prototype" 
            class="net.cedeo.jobscheduler.rest.JobResource" />
thboileau commented 9 years ago

I think there is a workaround, you can duplicate the declaration:

    <bean name="/rest/job" scope="prototype" class="net.cedeo.jobscheduler.rest.JobResource" />
    <bean name="/rest/job/{jobId}" scope="prototype" class="net.cedeo.jobscheduler.rest.JobResource" />

but we note the issue as an enhancement.

dscoppelletti commented 9 years ago

Yes, I actually I do that and this is quite good because the Restlet Resources are prototype beans. I think this issue is an enhancement, too.