1 package de.juplo.yourshouter;
3 import javax.inject.Inject;
4 import org.springframework.social.facebook.api.Account;
6 import org.springframework.social.facebook.api.Facebook;
7 import org.springframework.social.facebook.api.PagedList;
8 import org.springframework.stereotype.Controller;
9 import org.springframework.ui.Model;
10 import org.springframework.web.bind.annotation.RequestMapping;
11 import org.springframework.web.bind.annotation.RequestMethod;
15 * Controller, that handles requests to the root of the application.
20 public class PagesController
22 private final Facebook facebook;
26 public PagesController(Facebook facebook)
28 this.facebook = facebook;
32 @RequestMapping(value = "/pages.html", method = RequestMethod.GET)
33 public String list(Model model)
35 PagedList<Account> accounts = facebook.pageOperations().getAccounts();
36 model.addAttribute("accounts", accounts);