From: Bill B. <bb...@re...> - 2011-01-19 17:01:19
|
No, the @Path @Path("/messages/{id:.*}") public String getMEssageById(@PathParam("id") String id) {...} On 1/19/11 11:58 AM, Neil Chaudhuri wrote: > Version is 2.0.1.GA. > > So are you saying then that the endpoint method should look like this: > > public String getMessageById(@PathParam(".*") String id) { > return ""; > } > > Thanks. > > -----Original Message----- > From: Bill Burke [mailto:bb...@re...] > Sent: Wednesday, January 19, 2011 11:55 AM > To: res...@li... > Subject: Re: [Resteasy-developers] REST Endpoint Path With / > > {param} only matches to one segment. If you have "/" in your path > param, you must change the expression to: > > {param:.*} > > The error message bothers me though as it should be more informative. > What version of RESTEasy? thanks. > > On 1/19/11 11:37 AM, Neil Chaudhuri wrote: >> I have a REST endpoint marked with @Path("/messages /{id}"). >> >> When I make the call with the path parameter id having the value >> "MES/482bda7284054dbf-4654d73f00000000" (note the "/" buried in there), >> I get the following exception: >> >> org.jboss.resteasy.plugins.providers.jaxb.JAXBMarshalException: Could >> not find JAXBContextFinder for media type: text/html >> >> org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.findJAXBContext(AbstractJAXBProvider.java:50) >> >> org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.getMarshaller(AbstractJAXBProvider.java:127) >> >> org.jboss.resteasy.plugins.providers.jaxb.AbstractJAXBProvider.writeTo(AbstractJAXBProvider.java:103) >> >> org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:178) >> >> org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:574) >> >> org.jboss.resteasy.core.SynchronousDispatcher.writeFailure(SynchronousDispatcher.java:411) >> >> org.jboss.resteasy.core.SynchronousDispatcher.executeExactExceptionMapper(SynchronousDispatcher.java:274) >> >> org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:194) >> >> org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:124) >> >> org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:200) >> >> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:48) >> >> org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:43) >> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:717) >> >> When I make the call with the "/" character URL-encoded, I get a 400 Bad >> Request. >> >> Can you please provide some insight into how to handle a path parameter >> containing a slash? >> >> Thanks. >> >> >> >> ------------------------------------------------------------------------------ >> Protect Your Site and Customers from Malware Attacks >> Learn about various malware tactics and how to avoid them. Understand >> malware threats, the impact they can have on your business, and how you >> can protect your company and customers by using code signing. >> http://p.sf.net/sfu/oracle-sfdevnl >> >> >> >> _______________________________________________ >> 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 |