@@ -0,0 +1,1309 @@
+package com.google.sps.servlets;%0A%0Aimport com.google.appengine.api.users.UserService;%0Aimport com.google.appengine.api.users.UserServiceFactory;%0A%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0A%0Aimport com.google.sps.tool.GoogleTranslationAPI;%0Aimport java.util.Map;%0Aimport java.util.HashMap;%0Aimport com.google.gson.Gson;%0A%0A%0A@WebServlet(%22/translation%22)%0Apublic class TranslationServlet extends HttpServlet %7B%0A  %0A  @Override%0A  public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A    UserService userService = UserServiceFactory.getUserService();%0A%0A    if (userService.isUserLoggedIn()) %7B%0A      String rawText = request.getParameter(%22rawText%22);%0A      String toLang = request.getParameter(%22toLang%22);%0A      String fromLang = request.getParameter(%22fromLang%22);%0A%0A      String textTranslated = GoogleTranslationAPI.translateText(rawText, toLang);%0A%0A      // Aggregate information as a json %0A      Map%3CString, String%3E jsonInfo = new HashMap%3C%3E();%0A      jsonInfo.put(%22translation%22, textTranslated);%0A      response.setContentType(%22application/json;%22);%0A      response.getWriter().println(new Gson().toJson(jsonInfo));%0A    %7D%0A  %7D%0A%7D

Add Translation servlet