Exemplo n.º 1
0
 @Override
 protected void doGet(HttpServletRequest req, HttpServletResponse resp)
     throws ServletException, IOException {
   if (!req.getParameter("id").equals(null) && !req.getParameter("id").equals("")) {
     int id = Integer.valueOf(req.getParameter("id"));
     teamDao.delete(id);
   }
   resp.sendRedirect("team");
 }
Exemplo n.º 2
0
 @Override
 protected void doGet(HttpServletRequest request, HttpServletResponse response)
     throws IOException, ServletException {
   if (request.getParameter("id") != null) {
     Team team = teamDAO.get(Integer.parseInt(request.getParameter("id")));
     request.setAttribute("team", team);
     List<Country> countryList = countryDAO.getList();
     request.setAttribute("listCountry", countryList);
     response.setContentType("text/html;charset=UTF-8");
     request.getRequestDispatcher(prefix + "team" + sufix).forward(request, response);
   } else {
     response.sendRedirect(request.getContextPath());
   }
 }