Following changes got things working:
wrapper for Movie class to keep JAXB happy
@XmlRootElement(name="movies")
public class MovieList {
private List<Movie> movieList;
public MovieList() {}
public MovieList(List<Movie> movieList) {
this.movieList = movieList;
}
@XmlElement(name="movie")
public List<Movie> getMovieList() {
return movieList;
}
public void setMovieList(List<Movie> movieList) {
this.movieList = movieList;
}
}
controller
@RequestMapping(method=RequestMethod.GET)
public String findAllMovies(Model model) throws MovieNotFoundException {
List<Movie> movieList = movieManagementService.getAllMovies();
MovieList movies = new MovieList(movieList);
model.addAttribute("movies", movies);
return "movies";
}
sevlet application context
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="classesToBeBound">
<list>
<value>com.wickedlynotsmart.imdb.model.Movie</value>
<value>com.wickedlynotsmart.imdb.model.MovieList</value>
</list>
</property>
</bean>