try
{
id = Integer.parseInt(request.getParameter("id"));
if (request.getParameter("update") != null)
{
Todo t = todoManager.getTodo(id);
t.setName(request.getParameter("name"));
t.setDescription(request.getParameter("description"));
t.setPriority(Integer.parseInt(request.getParameter("priority")));
todoManager.update(t);
}
else if (request.getParameter("delete") != null)
{
todoManager.delete(id);