Advertisement
Guest User

Untitled

a guest
Nov 6th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. package no.hib.tod141.oblig2.jersey;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import javax.ws.rs.GET;
  7. import javax.ws.rs.Path;
  8. import javax.ws.rs.Produces;
  9. import javax.ws.rs.core.MediaType;
  10. import javax.ws.rs.core.Response;
  11.  
  12. import no.hib.tod141.oblig2.model.Report;
  13. import no.hib.tod141.oblig2.model.dao.ReportDAO;
  14. import no.hib.tod141.oblig2.model.dao.impl.ReportDAOImpl;
  15.  
  16. @Path("reports")
  17. public class RESTReports {
  18.    
  19.     ArrayList<Report> reports;
  20.    
  21.     public RESTReports() {
  22.         ReportDAO reportDAO = new ReportDAOImpl();
  23.         reports = (ArrayList<Report>) reportDAO.getReports();
  24.     }
  25.    
  26.     @GET
  27.     @Produces(MediaType.TEXT_PLAIN)
  28.     public Response getReports() {
  29.         String msg = "hello there";
  30.         return Response.status(200).entity(msg).build();
  31.     }
  32.    
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement