Created
January 3, 2012 02:28
-
-
Save jreyes/1553176 to your computer and use it in GitHub Desktop.
REST Server annotated service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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