Close

JAX-RS - JSON Response Examples

JAX-RS JAVA EE 

import com.logicbig.example.Customer;
import com.logicbig.example.CustomerDataService;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("customers")
public class CustomerRestService {
private CustomerDataService customerDataService = CustomerDataService.getInstance();

@GET
@Produces(MediaType.APPLICATION_JSON)
public List<Customer> getCustomers() {
return customerDataService.getCustomerList();
}
}
Original Post




See Also