The first thing needs to be done is adding RestletFrameworkServlet to web.xml as follows :
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext-business.xml
</param-value>
</context-param>
<!-- Loads the root application context of this web app at startup -->
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<!-- Spring Dispatcher Servlet which handles http requests
and invokes the appropriate controller -->
<servlet>
<servlet-name>springrest</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springrest</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
<!-- Restlet adapter -->
<servlet>
<servlet-name>rservlet</servlet-name>
<servlet-class>
com.noelios.restlet.ext.spring.RestletFrameworkServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Catch all request URIs starting with prefix /rest-->
<servlet-mapping>
<servlet-name>rservlet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
RestletFrameworkServlet extends from FrameworkServlet which is basically created to provide integration with Spring application context. Therefore for the requests ending with .html suffix are handled by Dispatcher Servlet and the requests starting with the prefix /rest are handled by RestletFrameworkServlet. Service definitions for the business logic are kept in applicationContext.business.xml file which is loaded at the startup of the application and all the bean definitions in this file are accessible from both Spring controllers and Restlet resources.
The next should be done is creating the rservlet-servlet.xml file which will contain restlets and resources in it.This file is parsed by RestletFrameworkServlet.
<?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="/users/{user}">
<bean class="org.restlet.ext.spring.SpringFinder">
<lookup-method name="createResource" bean="userResource" />
</bean>
</entry>
</map>
</property>
</bean>
<bean id="userResource" class="net.springrest.user.UserResource" scope="prototype" >
<!-- userService is a service which is used by both your web controller and rest resource
and it is defined in applicationContext-business.xml file -->
<property name="userService" ref="userService" />
</bean>
</beans>