}
return allUsers;
public void setAllUsers(List
}
public List
public void setAllNewsType(List
public int getNewsID() { return newsID;
}
public void setNewsID(int newsID) { this.newsID = newsID; }
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
public String getContent() { }
return content;
public void setContent(String content) { this.content = content; }
public java.sql.Date getReleaseDate() { return releaseDate; }
public void setReleaseDate(java.sql.Date releaseDate) { this.releaseDate = releaseDate; }
public int getUserID() { return userID;
}
public void setUserID(int userID) { this.userID = userID; }
public int getNewsTypeID() { return newsTypeID; }
public void setNewsTypeID(int newsTypeID) {
this.newsTypeID = newsTypeID;
}
public List
}
public void setAllNews(List
public int getPageSize() { return pageSize; }
public void setPageSize(int pageSize) { this.pageSize = pageSize; }
public int getPageNow() { return pageNow;
}
public void setPageNow(int pageNow) { this.pageNow = pageNow; }
public int getTotalCount() {
}
return totalCount;
public void setTotalCount(int totalCount) { }
public String createNews(){
HttpSession
session
=
this.totalCount = totalCount;
ServletActionContext.getRequest().getSession();
User user = (User)session.getAttribute(\News news = new News(); news.setTitle(this.title); news.setContent(this.content); news.setReleaseDate(this.releaseDate); news.setUserID(user.getId()); news.setNewsTypeID(this.newsTypeID);
NewsService newsService = new NewsServiceImpl(); newsService.createNews(news); this.allNews
=
newsService.queryAllNews(this.pageSize,
this.pageNow);
for(Iterator
News n = it.next();
User u1 = new UserServiceImpl().queryUser(n.getUserID()); n.setUser(u1); NewsType
newsType
=
new
NewsTypeServiceImpl().queryNewsType(n.getNewsTypeID());
}
public String showNews(){
NewsService newService = new NewsServiceImpl(); News news = newService.queryNews(this.newsID);
User user = new UserServiceImpl().queryUser(news.getUserID()); news.setUser(user); NewsType
newsType
=
new
}
this.totalCount = newsService.queryAllNews().size(); return SUCCESS;
n.setNewsType(newsType);
NewsTypeServiceImpl().queryNewsType(news.getNewsTypeID());
news.setNewsType(newsType);
HttpServletRequest request = ServletActionContext.getRequest(); request.setAttribute(\
this.allUsers = new UserServiceImpl().queryAllUsers(); this.allNewsType
=
new
NewsTypeServiceImpl().queryAllNewsTypes();
}
public String showAllNews(){
return SUCCESS;