HttpServletResponse response, BindException errors) {
Map<String, Object> map = new HashMap<String, Object>();
String chapterId = request.getParameter("id");
Map model = errors.getModel();
AppEngineUserService userService = new AppEngineUserService();
map.put("userService", userService);
model.put("model", map);
Chapter chapter = retrieveChapter(chapterId);
if (chapter == null) {
String errorText = "Failed to retrieve chapter with ID \"" + chapterId +
"\" -- chapter not found.";
model.put("errorText", errorText);
return new ModelAndView("admin_error", model);
}
if (!hasAccess(userService, chapter)) {
userService.setAfterLogoutEndpoint("/admin");
String errorText = "You are not listed as an organizer for this " +
"chapter. Please sign in with an organizer's account to access " +
"this page.";
model.put("errorText", errorText);