I'm new to Restlet and I'm getting 404 errors, so I'm guessing the
SpringServerServlet isn't being invoked in Tomcat 6. I'm trying out the Spring
extension in Restlet 2.0-M6. See attachment's web.xml and spring-beans.xml. I
think something basic is wrong, but not sure what. Thx.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-2.5.xsd">
<!-- required for autowiring -->
<context:annotation-config/>
<context:component-scan base-package="com.anides"> </context:component-scan>
<bean name="componentâ.context"
class="org.springframework.beans.factory.config.PropertyPathFactoryBeanâ"/>
<bean id="component" class="org.restlet.ext.spring.SpringComponent">
<property name="defaultTarget" ref="exampleRestletApplication"/>
<property name="context" ref="component.âcontext"/>
</bean>
<bean name="beanRouter" class="org.restlet.ext.spring.SpringBeanRouter"/>
<bean id="exampleRestletApplication"
class="com.anides.kia.restlet.example.ExampleRestletApplication">
<property name="root" ref="beanRouter"/>
</bean>
<bean name="/exampleResource" autowire="byName" scope="prototype"
class="com.anides.kia.restlet.example.ExampleResourceBean"> </bean>
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.3"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
<display-name>SpringRestlet</display-name>
<servlet>
<servlet-name>RestletSpring</servlet-name>
<servlet-class>
org.restlet.ext.spring.SpringServerServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
<init-param>
05 <param-name>org.restlet.component</param-name>
06 <!-- this value must match the bean id of the Restlet component you will configure in Spring (below) -->
07 <param-value>component</param-value>
08 </init-param>
</servlet>
<servlet-mapping>
<servlet-name>RestletSpring</servlet-name>
<url-pattern>/restlet/*</url-pattern>
</servlet-mapping>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>
<context-param>
<param-name>org.restlet.application</param-name>
<param-value>application</param-value>
</context-param>
</web-app>