Hi,

On Dec 31, 2009, at 1:59 PM, gozfidan wrote:

> Hi,
> I am new to REST and trying to integrate with my Spring application. I have
> done
> some searching bu got stuck. I have changed the web.xml and add
> RestletServlet-servlet.xml
> but not sure how to implement Resource?
> 
> 
> web.xml
>       <servlet>
>        <servlet-name>RestletServlet</servlet-name>
> 
> <servlet-class>org.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
>    </servlet>
>       
>       
> RestletServlet-servlet.xml
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>       xsi:schemaLocation="http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>
> 
>       <bean id="root" class="org.restlet.ext.spring.SpringRouter">
>        <property name="attachments">
>            <map>
>                <entry key="/poll">
>                    <bean class="org.restlet.ext.spring.SpringFinder">
>                        <lookup-method name="createResource"
> bean="pollSystemResource" />
>                    </bean>
>                </entry>
>            </map>
>        </property>
>    </bean>
> 
>    <bean id="pollSystemResource"
> class="com.smartcrop.webapp.service.PollSystemResource" autowire="byName"/>
> </beans>
> 
> 
> and I have this PollSystemResource if I extend it with SpringResource
> I get an error for  [cannot find symbol constructor SpringResource()]

You don't want to use SpringResource here.  From the javadoc:  "Spring Resource 
based on a Restlet Representation. DON'T GET CONFUSED, Spring's notion of 
Resource is different from Restlet's one, actually it's closer to Restlet's 
Representations."

Base PollSystemResource on org.restlet.resource.Resource (under 1.1) or 
org.restlet.resource.ServerResource (under 2.0).

Rhett

> 
> If my steps are correct, how do I implement my Resources
> thanks.
> -- 
> View this message in context: 
> http://n2.nabble.com/How-to-REST-in-SpringFramework-tp4237720p4237720.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
> 
> ------------------------------------------------------
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434026

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

Reply via email to