If @Path is not set then it is default to the empty value, ex, all the
methods getText1...getText6 match
GET /testqa
Accept: application/json
and the selection between those methods is random, possibly the 1st of
those methods but is not guaranteed...This is a standard 2.0 selection
process
Sergey
On 19/10/15 15:04, Sumit Arora wrote:
During my work I encountered below scenario, On which : getText1,
getText2,getText3,getText4,getText5,getText6 are without @Path annotations,
But when I call the API (http://localhost:8080/.../testqa/ )it always show
: {"name":"Sumit1 Arora","age":21,"address":"Lakshay1 Arora"}
@Service("qaservice")
@Path("/testqa")
public class SimpleQAImpl {
@GET
@Produces(MediaType.APPLICATION_JSON)
@Path("/simpleqa")
public Person getText() {
return new Person("Sumit Arora",21,"Lakshay Arora");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Person getText1() {
return new Person("Sumit1 Arora",21,"Lakshay1 Arora");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Person getText3() {
return new Person("Sumit3 Arora",21,"Lakshay3 Arora");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Person getText4() {
return new Person("Sumit4 Arora",21,"Lakshay4 Arora");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Person getText5() {
return new Person("Sumit5 Arora",21,"Lakshay5 Arora");
}
@GET
@Produces(MediaType.APPLICATION_JSON)
public Person getText6() {
return new Person("Sumit6 Arora",21,"Lakshay6 Arora");
}
}
May you please tell me how Apache CXF works, if @Path not given like the
case above or on other scenarios as well ?
'Sumit
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/