cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Purcell <joshua.purc...@gmail.com>
Subject Re: Question about JAX-RS Sub resources
Date Mon, 28 Apr 2008 04:26:29 GMT

Your example is a little different from the sample JAX-RS code included with
the CXF snapshot. This may work better for you:
@Path("/userservice/")
public class UserService {
  @Path("/users/{id}/")
  public User getUser(@PathParam("id") String id) {
    ... // load from db
  }
}

@XmlRootElement(name = "user")
public class User {
  @GET
  @Path("orders/{orderId}")
  public Order getOrder(@PathParam("orderId") orderId) {
  }
}

This would change your endpoint URL to:
http://localhost:9080/userservice/users/123/orders/456

scouredimage wrote:
> 
> I am trying to use the sub resource functionality as follows:
> 
> @Path("/users/")
> public class UserService {
> 
>   @Path("/users/{id}/")
>   public User getUser(@PathParam("id") String id) {
>     ... // load from db
>   }
>   
>   ...
> 
> }
> 
> public class User {
>   
>   @Path("orders/{orderId}")
>   public Order getOrder(@PathParam("orderId") orderId) {
>     ...
>   }
> 
>   ..
> }
> 
> When I try to access http://localhost:9080/users/123/orders/456 , I get a
> "No operation matching request path" fault. 
> 
> Any suggestions?
> 


-----
Joshua Purcell
-- 
View this message in context: http://www.nabble.com/Question-about-JAX-RS-Sub-resources-tp16927448p16930321.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message