final HttpServletResponse response, final ModelAndView modelAndView)
throws IOException {
try {
Map<String, Group> groups = lookupGroups(request, response);
String candidate = defaultGroup(modelAndView);
Group group = groups.remove(candidate);
if (group == null) {
group = groups.remove("defaults");
}
if (group == null) {
throw new InvalidGroupNameException("'" + candidate