Oh I like the idea of that... i've tried setting it up but now i'm getting
the following error:

Jan 22, 2009 3:16:58 PM org.restlet.Filter doHandle
WARNING: A filter was executed without a next Restlet attached to it.

Here is my web.xml:
<web-app>
  <display-name>Web Service</display-name>

  <!-- Restlet Adapter -->
  <servlet>
      <servlet-name>webservices</servlet-name>

<servlet-class>com.noelios.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
      <load-on-startup>1</load-on-startup>
  </servlet>

  <!-- Let Restlet capture all requests -->
  <servlet-mapping>
      <servlet-name>webservices</servlet-name>
      <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>

And here is my applicationContext
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:util="http://www.springframework.org/schema/util";
       xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd";>

    <!-- Restlet Setup -->
    <bean id="root" class="org.restlet.Application"/>
    <bean name="router" class="org.restlet.ext.spring.SpringBeanRouter"/>

    <!-- Restlet - Resource Definitions -->
    <bean name="/assets" id="assetsResource" autowire="byName"
scope="prototype"
        class="com.trilogy.engine.webservice.restlets.AssetsResource">
        <property name="assetDao" ref="assetDao"/>
    </bean>
    <bean name="/assets/{id}" id="assetResource" autowire="byName"
scope="prototype"
        class="com.trilogy.engine.webservice.restlets.AssetResource">
        <property name="assetDao" ref="assetDao"/>
    </bean>

    <bean name="/bodyparts" id="bodyPartsResource" autowire="byName"
scope="prototype"
        class="com.trilogy.engine.webservice.restlets.BodyPartsResource">
        <property name="bodyPartsDao" ref="assetDao"/>
    </bean>
    <bean name="/bodyparts/{id}" id="bodyPartResource" autowire="byName"
scope="prototype"
        class="com.trilogy.engine.webservice.restlets.BodyPartsResource">
        <property name="bodyPartsDao" ref="assetDao"/>
    </bean>
</beans>

Any ideas what could be wrong?

Jean-Philippe

On Wed, Jan 21, 2009 at 11:13 PM, Rhett Sutphin
<rh...@detailedbalance.net>wrote:

> Hi Jean-Philippe,
>
> On Jan 21, 2009, at 1:07 PM, Jean-Philippe Steinmetz wrote:
>
> > Quick question about attaching URI patterns and resource classes to
> > the router. Is there a way to make this happen more automagically
> > with annotations or some other mechanism? Adding each one by hand
> > will get unwieldy and requires touching the main Application class
> > every time I want to add a new resource. I see there is some work
> > with this with JAX-RS but I wasn't sure if this was included in
> > restlet or not.
>
> Since you are already using Spring, you might consider using
> SpringBeanRouter:
>
>
> http://www.restlet.org:8080/documentation/1.1/ext/org/restlet/ext/spring/SpringBeanRouter.html
>
> It allows you to define URI templates in your application context.  It
> also allows you to do Spring DI on the resource instances.
>
> Rhett
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1042895
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=1043753

Reply via email to