Example #1
0
  public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {

    String name = req.getParameter("name");
    String labels = req.getParameter("labels");

    if (name != null) {
      name = name.trim();
      if (!name.isEmpty()) {
        TaskRepository repository = new TaskRepository();
        try {
          repository.addTaskWithLabels(name, labels);
        } finally {
          repository.close();
        }
      }
    }
    resp.sendRedirect("/list/");
  }
Example #2
0
 public void close() {
   repository.close();
 }