Guest User

Untitled

a guest
Jan 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. @Controller
  2. public class timesheetController
  3. {
  4. @Autowired
  5. private CustomerDAO customerDAO;
  6.  
  7. @GetMapping("/getCustomers")
  8. public String getCustomers(Model view)
  9. {
  10. //get customers from dao
  11. List<Customer> results = customerDAO.getCustomers();
  12.  
  13. //add the customers to the model
  14. view.addAttribute("customers", results);
  15.  
  16. return "list-customers";
  17. }
  18. }
  19.  
  20. {
  21. "Customer_Code": T77A,
  22. "Customer_Name": CustomerName1
  23. },
  24. {
  25. "Customer_Code": T77B,
  26. "Customer_Name": CustomerName2
  27. }
  28.  
  29. @Controller
  30. public class timesheetController
  31. {
  32. @Autowired
  33. private CustomerDAO customerDAO;
  34.  
  35. @GetMapping("/getCustomers")
  36. public List<Customer> getCustomers()
  37. {
  38. //get customers from dao
  39. List<Customer> results = customerDAO.getCustomers();
  40.  
  41. return results;
  42. }
  43. }
Add Comment
Please, Sign In to add comment