Skip to content

Instantly share code, notes, and snippets.

@jreyes
Created January 3, 2012 02:28
Show Gist options
  • Save jreyes/1553176 to your computer and use it in GitHub Desktop.
Save jreyes/1553176 to your computer and use it in GitHub Desktop.
REST Server annotated service
@Path("/elementos")
public class ElementoQuimicoServicio
{
private ElementoQuimicoDAO dao = new ElementoQuimicoDAO();
@GET
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public List<ElementoQuimico> encontrarTodos()
{
return dao.encontrarTodos();
}
@GET
@Path("numero/{id}")
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
public ElementoQuimico encontrarPorNumeroAtomico( @PathParam("id") int numeroAtomico )
{
return dao.encontratPorNumeroAtomico( numeroAtomico );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment