import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class VoteServlet  extends HttpServlet {
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    }
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
           // 获取页面中的数据
         String [] vts=  req.getParameterValues("vt");

        VoteDao  dao=new VoteDao();
        //数据库中修改数据
        dao.update(vts);

        //跳转到结果页面
        req.getRequestDispatcher("result.jsp").forward(req,resp);
    }
}
