/** * 查看一条新闻 * * @param model * @param newsId * @return */ @RequestMapping(value = "/news/view/{newsId}", method = RequestMethod.GET) public String viewNews(Model model, @PathVariable("newsId") int newsId) { V9News news = newsDao.getById(newsId); model.addAttribute("news", news); System.out.println(news); return "admin/news/viewnews"; }
/** * 编辑资讯,获取待编辑的内容 * * @param model * @param newsId * @return */ @RequestMapping(value = "/news/edit/{newsId}", method = RequestMethod.GET) public String editNews(Model model, @PathVariable("newsId") int newsId) { V9News news = newsDao.getById(newsId); model.addAttribute("news", news); return "admin/news/editnews"; }