Skip to content

Instantly share code, notes, and snippets.

@rederlo
Created September 16, 2015 02:10
Show Gist options
  • Save rederlo/8150a05e494215c16f80 to your computer and use it in GitHub Desktop.
Save rederlo/8150a05e494215c16f80 to your computer and use it in GitHub Desktop.
Example rest with json return
package br.com.skel.api;
import java.util.ArrayList;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import br.com.skel.dao.ClientDao;
import br.com.skel.pojo.ClientPojo;
@Path("/client")
public class Client{
/**
*
*/
@GET
@Produces("application/json")
public ArrayList<ClientPojo> test(){
ArrayList<ClientPojo> cli = new ClientDao().listAll();
return cli;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment