lundi 20 juillet 2015

How to respond to queries in jax-rs

I've been doing this JAX-RS project and I have a question about queries. Let's say I want to add Users to my WEB application. I would create an entity from my database, then get information with DAO class and create controller for user. It should look something like this:

@Path("user")
public class UserController {

@GET
@Produces(MediaType.TEXT_PLAIN)
public String getIt() {
    return "GOT IT";
}
}

So, my question is when I start the server on localhost, how do I listen on .../user on my machine?

Aucun commentaire:

Enregistrer un commentaire