|
From: Dave M. <da...@pa...> - 2013-01-18 15:01:47
|
(Hands off to RESTeasy, not JaxRS I should have said)
On Fri, Jan 18, 2013 at 3:00 PM, Dave Minter <da...@pa...> wrote:
> But this is hooked up via Spring so I'm actually using a Spring
> DispatcherServlet which hands off to JaxRS to handle the actual request via
> the default configuration in springmvc-resteasy.xml
>
> I'm fairly sure Spring DispatcherServlet can field non-default HTTP verbs
> but I'll double-check.
>
>
> On Fri, Jan 18, 2013 at 2:55 PM, Bill Burke <bb...@re...> wrote:
>
>> Resteasy does override the service method. see HttpServletDispatcher
>>
>> On 1/18/2013 9:47 AM, Dave Minter wrote:
>> > 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...
>> > <mailto: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...>
>> > > <mailto: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 <http://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...
>> > <mailto: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 <http://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...
>> > <mailto:Res...@li...>
>> > https://lists.sourceforge.net/lists/listinfo/resteasy-developers
>> >
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>> > 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
>>
>
>
|