I tried integrating Spring into a little sample application following the
information in:

http://wiki.restlet.org/docs_1.1/13-restlet/28-restlet/70-restlet.html

(I did a few adjustements as the wiki was written for Restlet 1.x).

Even so I did get it running all requests, GET or POST, seem to call the
method defined as GET in my resource. My resource AuthorsResource 
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/AuthorsResource.java
AuthorsResource.java  extends the class ServerResource and defines two
methods:

  @Get("json")
   public String toJson() 
   {
      System.out.println("AuthorsResource.toJson");
      .......
   }

   @Post("json")
   public String acceptJson(String value)
   {
      System.out.println("AuthorsResource.acceptJson: input param: value=" +
value);
      .....
   }

I have a little test (
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/TestClient.java
TestClient.java ) which makes calls to Restlet App:
1. gets the list of authors (GET)
2. adds a new author to the list (POST)
3. gets the list of authors (GET)

When running the Restlet App without Spring Integration (
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/LibraryStandaloneApp.java
LibraryStandaloneApp.java ), then GET requests are routed to the GET method
and POST requests are routed to the POST method  AuthorsResource. 

However when running the Restlet App with Spring Integration (
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/LibrarySpringStandaloneApplication.java
LibrarySpringStandaloneApplication.java ) then GET and POST requests are
routed to the GET method in the AuthorsResource. 

I am wondering what I am doing wrong. Is there anything missing in my bean
descriptor (
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/library-application-context.xml
library-application-context.xml ) ?

Is there an example for Spring Integration in Restlet 2.0?

Thanks.

P.S. Additional classes in my little example:
- Author bean 
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/Author.java
Author.java 
- Mock DAO 
http://restlet-discuss.1400322.n2.nabble.com/file/n5185908/MockLibraryDao.java
MockLibraryDao.java 



-- 
View this message in context: 
http://restlet-discuss.1400322.n2.nabble.com/Problems-with-Spring-Integration-for-Restlet-2-0-RC3-tp5185908p5185908.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

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

Reply via email to