Spring Extension REST Resource @RequestParam annotation not detected
trying to use the spring extension of Restlet , have configured as per the example http://wiki.restlet.org/docs_2.1/13-restlet/28-restlet/70-restlet/196-restlet.html In addition to that trying to capture the request parameters using the @RequestParam annotation but end up getting the parameter value as null.
Resource looks like,
class MyResource extends ServerResource implements IResource {
@Get
@RequestMapping(value="/id")
public void get(@RequestParam(value="name") String name) {
...
}
}
HTTP Request http://localhost:8080/messa开发者_如何学Goges/id?name=XXX Web.xml looks like
<servlet>
<servlet-name>test-servlet</servlet-name>
<servlet-class>org.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
</servlet>
<!-- Catch all requests -->
<servlet-mapping>
<servlet-name>test-servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
In the end the name value is 'null'. I think the spring based annotations are not detected. I have no clue why this is happening?
精彩评论