package commands;

import java.io.IOException;
import java.util.*;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import spring.Context;

import business.*;

import dao.*;

public class TurmaPrepararRemocao extends AbstractCommand
{

	private TurmaDAO turmaDAO = DAOFactory.getInstance().getTurmaDAO();

	public void processarComando(HttpServletRequest request,
			HttpServletResponse response, Context context)
	{

		List<Turma> turmas = turmaDAO.listarTurmas();
		
		request.setAttribute("turmas",turmas);
		
		RequestDispatcher rd = request.getRequestDispatcher("turmaRemover.jsp");
		
		try
		{
			rd.forward(request,response);
		}
		catch (ServletException e)
		{
			e.printStackTrace();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}

}
