@RequestMapping("/createTodo")
public ModelAndView createTodo(HttpServletRequest request, HttpServletResponse response) {
String title = request.getParameter("title");
String body = request.getParameter("body");
String userName = request.getRemoteUser();
ToDo todo = null;
try {
todo = todoService.createToDo(title, body, userName);
} catch (ButterflyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Map<String, String> model = Maps.newHashMap();
model.put("id", "" + todo.getId());
model.put("title", todo.getTitle());
model.put("body", todo.getDetails());
model.put("displayDate", DateHelper.getTimeAgo(todo.getCreationDate()));
return new ModelAndView("ajax_todo_created", model);
}