hlhlz

导航

8080/ 的访问方式

@RequestMapping("/")
String home() {
return "redirect:countries";
}

这个在启动项目中即可8080放问指定页面

 

 

 

 

--------------------------

@Controller
@RequestMapping("/countries")
public class CountryController {

@Autowired
private CountryService countryService;

@RequestMapping
public ModelAndView getAll(Country country) {
ModelAndView result = new ModelAndView("index");
List<Country> countryList = countryService.getAllByWeekend(country);
result.addObject("pageInfo", new PageInfo<Country>(countryList));
result.addObject("queryParam", country);
result.addObject("page", country.getPage());
result.addObject("rows", country.getRows());
System.out.println("进来了");
return result;
}

posted on 2018-05-11 11:14  hlhlz  阅读(185)  评论(0编辑  收藏  举报