@RequestMapping(value = "/movies/{movieId}", method = RequestMethod.GET, headers = "Accept=text/html")
public String singleMovieView(final Model model, @PathVariable String movieId) {
User user = addUser(model);
Movie movie = moviesRepository.getMovie(movieId);
model.addAttribute("id", movieId);
if (movie != null) {
model.addAttribute("movie", movie);
final int stars = movie.getStars();
model.addAttribute("stars", stars);
Rating rating = null;
if (user!=null) rating = movie.getRelationshipTo(user, Rating.class, "RATED");
if (rating == null) rating = new Rating().rate(stars,null);
model.addAttribute("userRating",rating);
}
return "/movies/show";
}