So, I've got the following method in the Controller:
@RequestMapping(value="/modules.htm",method = RequestMethod.GET )
protected String modules(ModelMap model) throws Exception {
List<Module> modules = moduleService.getStudentModules(course_id);
model.addAttribute....?
return "modules";
}
And I need to display this list in jsp View, like:
<h1>Modules: </h1>
module 1
module 2... etc
What do I need to add to show the full list on the JSP page? How should I upload it to the model and retrieve it? Thank you in advance.
Pass the whole list:
model.addAttribute("modules", modules);
Then iterate on it:
<c:forEach items="${modules}" var="module">
${module.anyProperty}
</c:forEach>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With