Tag: modelandview

使用Spring显示JSP上的值列表

我想在我的jsp视图中显示我的值列表,但我无法做到这一点。 这是我的控制器类,它只是将List添加到ModelAndView映射,而不是重定向到我的index.jsp页面。 EmployeeController @Controller public class EmployeeController { @RequestMapping(value={“/employee”}, method = RequestMethod.GET) public String listEmployee(){ System.out.println(“Kontroler EmployeeController”); LinkedList list = getList(); ModelAndView map = new ModelAndView(“index”); map.addObject(“lists”, list); return map.getViewName(); } private LinkedList getList(){ LinkedList list = new LinkedList(); list.add(“Item 1”); list.add(“Item 2”); list.add(“Item 3”); return list; } } 的index.jsp Welcome to Spring Web MVC […]