Example #1
0
 @GET
 // entre chaves( { } ) significa que é um parametro
 @Path("/{id_heroi}")
 @Produces("application/json")
 public HeroiJson getHeroiByID(@PathParam("id_heroi") int id) {
   return heroiSingleton.getHeroibyId(id);
 }
Example #2
0
  // Add business logic below. (Right-click in editor and choose
  // "Insert Code > Add Business Method")
  @GET
  // entre chaves( { } ) significa que é um parametro
  @Path("/lista")
  @Produces("application/json")
  public List<HeroiJson> getListHeroi() {

    return heroiSingleton.getListHeroi();
  }