@RequestMapping("/")
public String index(Model model){
Person single=new Person("aa",11);
List<Person> people =new ArrayList<Person>();
Person p1=new Person("xx",22);
Person p2=new Person("dd",33);
Person p3=new Person("zz",44);
people.add(p1);
people.add(p2);
people.add(p3);
model.addAttribute("singlePerson",single);
model.addAttribute("people",people);
return "index";
}
@RequestMapping("/")
public String index(Model model){
Person single=new Person("aa",11);
List<Person> people =new ArrayList<Person>();
Person p1=new Person("xx",22);
Person p2=new Person("dd",33);
Person p3=new Person("zz",44);
people.add(p1);
people.add(p2);
people.add(p3);
model.addAttribute("singlePerson",single);
model.addAttribute("people",people);
return "index";
}