@RequestMapping(value = "/{id}", params = "form", method = RequestMethod.GET)
public String updateForm(@PathVariable("id") Long id,
@ModelAttribute("currentUserAccountId") Long userId,
Model model) {
Recommendation foundRec = findRecommendation(userId, id);
RecommendationFormBean recBean = new RecommendationFormBean();
if (foundRec != null) {
recBean.setComments(foundRec.getComment());
recBean.setId(foundRec.getRelationshipId());
recBean.setRating(foundRec.getStars());
recBean.setName(foundRec.getRestaurant().getName());
recBean.setRestaurantId(foundRec.getRestaurant().getId());
}
model.addAttribute("recommendation", recBean);
model.addAttribute("itemId", recBean.getId());
return "recommendations/update";
}