package ru.javastudy.spring.mvc;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import ru.javastudy.spring.cats.Cat;
import ru.javastudy.spring.cats.CatsFactory;

import java.util.List;

@Controller
public class ExcelController {

    @RequestMapping(value = "/downloadExcel", method = RequestMethod.GET)
    public ModelAndView getExcel() {
        List<Cat> cats = CatsFactory.createCats();
        return new ModelAndView("excelView", "catsList", cats);
    }

}
