@@ -0,0 +1,1360 @@
+package com.google.sps.servlets;%0A%0Aimport com.google.gson.Gson;%0Aimport java.io.IOException;%0Aimport java.util.LinkedHashMap;%0Aimport java.util.Scanner;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A/** Returns the data as a JSON object, e.g. %7B%22Rachel%22: 52, %22Monica%22: 34%7D%5D */%0A@WebServlet(%22/friends-data%22)%0Apublic class FriendsDataServlet extends HttpServlet %7B%0A%0A    private LinkedHashMap%3CString, Integer%3E cupsPerPerson = new LinkedHashMap%3C%3E();%0A%0A    @Override%0A    public void init() %7B%0A        Scanner scanner = new Scanner(getServletContext().getResourceAsStream(%0A            %22/WEB-INF/cups-per-person.csv%22));%0A        while (scanner.hasNextLine()) %7B%0A            String line = scanner.nextLine();%0A            String%5B%5D cells = line.split(%22,%22);%0A%0A            String name = String.valueOf(cells%5B0%5D);%0A            Integer cups = Integer.valueOf(cells%5B1%5D);%0A%0A            cupsPerPerson.put(name, cups);%0A        %7D%0A        scanner.close();%0A    %7D%0A%0A    @Override%0A    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A        response.setContentType(%22application/json%22);%0A        Gson gson = new Gson();%0A        String json = gson.toJson(cupsPerPerson);%0A        response.getWriter().println(json);%0A    %7D%0A%7D

Create the Java Servlet for the chart.