

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class Control
 */
@WebServlet("/Control")
public class Control extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public Control() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
		// Set default page.
		String nextPage = "home.jsp";
		
		String action = request.getParameter("action");
		if (action.equals("login")) {
			
		}
		
		// Dispatch control.
		RequestDispatcher myRequestDispatcher = request.getRequestDispatcher("/" + nextPage);
		myRequestDispatcher.forward(request, response);
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

}

@@ -25,16 +25,40 @@
 eption;%0D
+%0Aimport java.util.List;%0D
 %0A%0D%0Aimpor
@@ -315,16 +315,118 @@
 nse;%0D%0A%0D%0A
+import steamParser.GameBean;%0D%0Aimport steamParser.GamesManager;%0D%0Aimport steamParser.SteamIdManager;%0D%0A%0D%0A
 /**%0D%0A * 
@@ -1033,20 +1033,16 @@
 .jsp%22;%0D%0A
-%09%09%0D%0A
 %09%09String
@@ -1088,44 +1088,542 @@
 );%0D%0A
-%09%09if (action.equals(%22login%22)) %7B%0D%0A%09%09%09
+%0D%0A%09%09if (action == null)%7B%0D%0A%09%09%09action = %22home%22;%0D%0A%09%09%7D%0D%0A%0D%0A%09%09if (action.equals(%22gamesRequest%22)) %7B%0D%0A%09%09%09String username = request.getParameter(%22username%22);%0D%0A%09%09%09String steamid = SteamIdManager.getSteamId(username);%0D%0A%09%09%09System.out.println(steamid);%0D%0A%09%09%09if (steamid == null) %7B%0D%0A%09%09%09%09// Do something here%0D%0A%09%09%09%09// Print that user does not have vanity id, must use steamid instead.%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09List%3CGameBean%3E games = GamesManager.getGames(steamid);%0D%0A%09%09%09%09request.getSession().setAttribute(%22games%22, games);%09%09%09%09%0D%0A%09%09%09%7D%0D%0A%09%09%09nextPage = %22games.jsp%22;
 %0D%0A%09%09

Handle gamesRequest and retrieves user's games list.