public String write() { // 新建文章 User user = (User) session.get("user"); System.out.println("User的ID是" + user.getUserid()); News news = new News(user, nvo.getNewstitle(), nvo.getNewscontent(), new Date()); System.out.println("文章标题是" + news.getNewstitle()); ns.add(news); return "writeSuccess"; }
public String delete() { // 文章删除 news = ns.findById(this.newsid); ns.delete(news); return "delete"; }
public String look() { // 文章具体内容 news = ns.findById(this.newsid); return "look"; }
public String list() { // 文章列表 newslist = ns.findAll(); return "list"; }