|
From: Dave M. <da...@pa...> - 2013-01-18 14:47:37
|
No, that's just the default behaviour if you don't override the service
method in a servlet. If you hook up the following servlet in web.xml you
get the outputs that you'd hope for:
public class ResetServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public ResetServlet() {
super();
}
@Override
protected void service(final HttpServletRequest request, final
HttpServletResponse response) throws ServletException, IOException {
if ("RESET".equals(request.getMethod())) {
response.getWriter().write("<html><body><p>Received a RESET
request!</p></body></html>");
} else {
response.getWriter().write(String.format("<html><body><p>Received some
other (%s) request.</p></body></html>", request.getMethod()));
}
}
}
On Fri, Jan 18, 2013 at 1:54 PM, Bill Burke <bb...@re...> wrote:
> I agree with Robert's earlier post, but are you sure this isn't Tomcat
> barfing on you? There's really nothing I can do about that.
>
> On 1/18/2013 5:23 AM, Dave Minter wrote:
> >
> > res...@li...
> > <mailto: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...?
> >
> >
> >
> >
> ------------------------------------------------------------------------------
> > Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
> > much more. Get web development skills now with LearnDevNow -
> > 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> > SALE $99.99 this month only -- learn more at:
> > http://p.sf.net/sfu/learnmore_122812
> >
> >
> >
> > _______________________________________________
> > Resteasy-developers mailing list
> > Res...@li...
> > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
> >
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
> much more. Get web development skills now with LearnDevNow -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> _______________________________________________
> Resteasy-developers mailing list
> Res...@li...
> https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>
|