@@ -0,0 +1,2337 @@
+package com.google.sps.servlets;%0A%0Aimport com.google.sps.data.VolunteeringOpportunity;%0Aimport com.google.sps.utilities.CommonUtils;%0Aimport com.google.sps.utilities.DatabaseWrapper;%0Aimport java.io.IOException;%0Aimport java.io.PrintWriter;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URL;%0Aimport java.util.ArrayList;%0Aimport java.util.HashSet;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Set;%0Aimport javax.servlet.annotation.WebServlet;%0Aimport javax.servlet.http.HttpServlet;%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0A%0A@WebServlet(%22/volunteering-form-handler%22)%0Apublic class VolunteeringFormHandlerServlet extends HttpServlet %7B%0A  private static final String VOLUNTEER_TYPE = %22volunteer-type%22;%0A  private static final String VOLUNTEER_NUMBER = %22volunteer-number%22;%0A  private static final String SKILL = %22skill%22;%0A%0A  @Override%0A  public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException %7B%0A    String volunteerName =%0A        CommonUtils.getParameter(request, VOLUNTEER_TYPE, /* DefaultValue= */ %22%22);%0A%0A    Integer volunteerNumber = Integer.parseInt(%0A        CommonUtils.getParameter(request, VOLUNTEER_NUMBER, /* DefaultValue= */ %220%22));%0A%0A    Set%3CString%3E skills = new HashSet%3CString%3E();%0A%0A    String currentSkill = %22%22;%0A    int skillNumber = 0;%0A    do %7B%0A      currentSkill = CommonUtils.getParameter(%0A          request, String.format(%22skill%25d%22, skillNumber), /* DefaultValue= */ %22%22);%0A      if (!currentSkill.isEmpty())%0A        skills.add(currentSkill);%0A      skillNumber++;%0A    %7D while (!currentSkill.isEmpty());%0A%0A    insertVolunteeringOpportunityIntoDB(volunteerName, volunteerNumber, skills);%0A%0A    response.sendRedirect(%22/events-feed.html%22);%0A  %7D%0A%0A  private void insertVolunteeringOpportunityIntoDB(%0A      String volunteerName, Integer volunteerNumber, Set%3CString%3E requiredSkills) %7B%0A    DatabaseWrapper dbWrapper = new DatabaseWrapper(%22step-188-instance%22, %22event-organizer-db%22);%0A    VolunteeringOpportunity opportunity =%0A        new VolunteeringOpportunity%0A            .Builder(%220883de79-17d7-49a3-a866-dbd5135062a8%22, volunteerName, volunteerNumber)%0A            .setRequiredSkills(requiredSkills)%0A            .build();%0A    // TO DO: change eventId to non-hardcoded value%0A    dbWrapper.insertVolunteeringOpportunity(opportunity);%0A  %7D%0A%7D

Add insertion form handler.