--- /dev/null
+package de.juplo.yourshouter;
+
+import javax.inject.Inject;
+import org.springframework.social.facebook.api.Account;
+
+import org.springframework.social.facebook.api.Facebook;
+import org.springframework.social.facebook.api.PagedList;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+
+/**
+ * Controller, that handles requests to the root of the application.
+ *
+ * @author Kai Moritz
+ */
+@Controller
+public class PagesController
+{
+ private final Facebook facebook;
+
+
+ @Inject
+ public PagesController(Facebook facebook)
+ {
+ this.facebook = facebook;
+ }
+
+
+ @RequestMapping(value = "/pages.html", method = RequestMethod.GET)
+ public String list(Model model)
+ {
+ PagedList<Account> accounts = facebook.pageOperations().getAccounts();
+ model.addAttribute("accounts", accounts);
+ return "pages";
+ }
+}
<li><a href="profile.html" th:href="@{/profile.html}">Show public profile-data</a></li>
<li><a href="#" th:href="@{/h2-console}">Connect to the H2-console</a></li>
<li><a href="permissions.html" th:href="@{/permissions.html}">Manage permissions</a></li>
+ <li><a href="pages.html" th:href="@{/pages.html}">Show pages, that you are an administrator of</a></li>
</ul>
</body>
</html>
--- /dev/null
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
+ <head>
+ <title>Pages</title>
+ </head>
+ <body>
+ <p>Back <a href="home.html" th:href="@{/}">HOME</a></p>
+ <hr />
+ <h1>The permissions you granted to this app</h1>
+ <ul>
+ <li th:each="permission : ${permissions}" th:text="${permission}">public_profile</li>
+ </ul>
+ <h1>Pages, you are an administrator of</h1>
+ <ul th:each="account : ${accounts}">
+ <li><strong>ID:</strong> <em th:text="${account.id}">123456789</em></li>
+ <li><strong>Name:</strong> <em th:text="${account.name}">Spielwiese</em></li>
+ <li><strong>Category:</strong> <em th:text="${account.category}">Unknown</em></li>
+ </ul>
+ </body>
+</html>