@Path("/users/A")
public class UserResource1 {
@GET
@Produces("text/xml")
public String getUser(@PathParam("username") String userName) {
...
}
}
@Path("/users/B")
public class UserResource2 {
@GET
@Produces("text/xml")
public String getUser(@PathParam("username") String userName) {
...
}
}
you can have same method name and request mapping with different path url
/*
To handle A type users logic
http://localhost:8080/users/A
*/
@Path("/users/A")
public class UserResource1 {
@GET
@Produces("text/xml")
public String getUser(@PathParam("username") String userName) {
}
}
/*
To handle B type users logic
http://localhost:8080/users/B
*/
@Path("/users/B")
public class UserResource2 {
@GET
@Produces("text/xml")
public String getUser(@PathParam("username") String userName) {
}
}
finally you have two end points