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
   servlet
servlet-nameRestletServlet/servlet-name
 
 servlet-classorg.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=4447dsMessageId=2434026

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=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.

bean id=/pollSystemResource
class=com.smartcrop.webapp.service.PollSystemResource autowire=byName/
/beans

Rather than:

bean id=pollSystemResource
class=com.smartcrop.webapp.service.PollSystemResource autowire=byName/
/beans

Then your Router need only be:

bean id=root class=org.restlet.ext.spring.SpringRouter /

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
servlet
servlet-nameRestletServlet/servlet-name
   
servlet-classorg.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()]

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=4447dsMessageId=2434026

--
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=2434317attachment: winmail.dat

How to REST in SpringFramework

2010-01-01 Thread gozfidan
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-nameRestletServlet/servlet-name
   
servlet-classorg.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()]

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=4447dsMessageId=2434026