|
From: Dave M. <da...@pa...> - 2013-01-18 10:23:54
|
res...@li...
I'd like to use custom HTTP verbs with resteasy running under Tomcat. Is
this possible? If it is possible is it sensible?
I'm using resteasy 2.3.4.Final with Spring 3.1.2-RELEASE and I've created a
custom HttpMethod annotation for the new verb:
@Target({ ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("RESET")
public @interface RESET {
}
Spring is configured in the servlet application context with the default
resteasy config thus:
<tx:annotation-driven />
<import resource="classpath:springmvc-resteasy.xml" />
The new method in the controller is implemented thus:
@RESET
@Path("/{uuid}")
public void reset(@PathParam("uuid") final String uuid) {
// Reset the model state...
}
My other controller methods work fine for the normal GET,PUT,POST,DELETE
verbs but for the custom verb I get the following error message from Tomcat:
HTTP Status 501 - Method RESET is not defined in RFC 2068 and is not
supported by the Servlet API
That message seems to be the same one that you get with a default servlet
implementation so I presume I need to configure the ResteasyHandlerMapping
somehow...?
|