I'm new at Restful webservices and im trying to create a WS server to work with an android app. I'm using Netbeans and i followed this tuturial to get started (http://netbeans.org/kb/docs/websvc/rest.html) . I was able to successfully teste the basic features as explained in the tuturial. But now I am not able to add a new feature to the WS. Say I have a table in my DB called User. With the tuturial I can access the table Users by ID trhough the function
@GET
@Path("{id}")
@Produces(
{
"application/xml", "application/json"
})
public User find(@PathParam("id") Integer id)
{
return super.find(id);
}
The problem is if I want to get a User by its name for example. If I create a similar function like
@GET
@Path("{name}")
@Produces(
{
"application/xml", "application/json"
})
public User find(@PathParam("name") String name)
{
return super.find(name);
}
The server crashes. So my question is , what's the procedure to be able to get a User by other parameters different of id.
Thank you