Is it possible to display a variable-length list (or set) of Strings in a JSP page using the Spring framework ?
Currently I have the following in my Java Controller :-
@Controller
@RequestMapping("/")
public class HelloController
{
@RequestMapping(method = RequestMethod.GET)
public String printHello(ModelMap model)
{
model.addAttribute("message1", "Cat");
model.addAttribute("message2", "Dog");
model.addAttribute("message3", "Fish");
model.addAttribute("message4", "Bird");
return "hello";
}
}
Currently I have the following in "hello.jsp" :-
<%@ page contentType="text/html; charset=UTF-8" %>
<html>
<head>
<title>Hello World</title>
</head>
<body>
<p>${message1}</p>
<p>${message2}</p>
<p>${message3}</p>
<p>${message4}</p>
</body>
</html>
Is it possible to do this but with a variable-length list (or set) ?
Thank you for your time,
James