コード例 #1
0
 // find a users payment cards - via AJAX
 @RequestMapping(
     value = "{username}/view.json",
     method = RequestMethod.GET,
     headers = "Accept=application/json")
 public @ResponseBody List<PaymentCard> view(@PathVariable String username) {
   List<PaymentCard> cards = paymentCardService.findPaymentCards(username);
   return cards;
 }
コード例 #2
0
 // list all of the users PaymentCards - form
 @RequestMapping(method = RequestMethod.GET)
 public String listForm(Model model, Principal currentUser) {
   List<PaymentCard> paymentCards = null;
   if (currentUser != null) {
     paymentCards = paymentCardService.findPaymentCards(currentUser.getName());
   }
   model.addAttribute("paymentCardList", paymentCards);
   return "cards/list";
 }