How to get ArrayList in JSP files using spring mvc

Viewed 1843
@RequestMapping("/get")
    public ModelAndView add()
    //public void Connector()
    {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationcontext.xml");
        EmployeeDao dao=(EmployeeDao) ctx.getBean("edao");
        List<Employee> list=dao.getAllEmployees();

        ModelAndView mv=new ModelAndView();


        mv.setViewName("display1.jsp");
        mv.addObject("emp", list);
        return mv;
        //System.out.println(dao.getAuth());

    }

I am trying to display the list to jsp using jstl with modelAndView object I am getting the list from database and but not able to print it on jsp. please help me thankyou

1 Answers
Related