protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { NewsletterDao newsletterDao = new NewsletterDaoBean(); String Email = request.getParameter("email"); String mailNews = request.getParameter("mailInput"); Newsletter n = new Newsletter(); List<Newsletter> newsletters = null; if (mailNews != null) { newsletters = newsletterDao.getAllNewsletter(); for (Newsletter news : newsletters) { NewsletterUtils.sendNewsletter(news.getEmail(), mailNews); } return; } n.setEmail(Email); newsletterDao.addNewsletter(n); }