@RequestMapping(value = "{id}", method = POST)
public String save(@Valid Project project, @RequestParam(defaultValue = "") List<String> releasesToDelete,
@RequestParam String groupId) {
Iterator<ProjectRelease> iReleases = project.getProjectReleases().iterator();
while (iReleases.hasNext()) {
ProjectRelease release = iReleases.next();
if ("".equals(release.getVersion()) || releasesToDelete.contains(release.getVersion())) {
iReleases.remove();
}
release.setGroupId(groupId);
String version = release.getVersion();
release.setApiDocUrl(release.getApiDocUrl().replaceAll(VERSION_PATTERN, version));
release.setRefDocUrl(release.getRefDocUrl().replaceAll(VERSION_PATTERN, version));
}
service.save(project);
return "redirect:" + project.getId();