Re: How to REST in SpringFramework

2010-01-04 Thread Rhett Sutphin
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
>   
>RestletServlet
> 
> org.restlet.ext.spring.RestletFrameworkServlet
>
>   
>   
> RestletServlet-servlet.xml
> 
> 
> 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="pollSystemResource" />
>
>
>
>
>
> 
> class="com.smartcrop.webapp.service.PollSystemResource" autowire="byName"/>
> 
> 
> 
> 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


RE: How to REST in SpringFramework

2010-01-02 Thread Jenkins, Dustin
The bean name or id needs to be the path to the Resource.




Rather than:




Then your Router need only be:



Dustin


-Original Message-
From: gozfidan [mailto:gur...@resolution.com]
Sent: Thu 12/31/2009 11:59 AM
To: discuss@restlet.tigris.org
Subject: How to REST in SpringFramework
 
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

RestletServlet
   
org.restlet.ext.spring.RestletFrameworkServlet



RestletServlet-servlet.xml


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";>

















and I have this PollSystemResource if I extend it with SpringResource
I get an error for  [cannot find symbol constructor SpringResource()]

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=2434317<>