【Java开源代码栏目提醒】:网学会员鉴于大家对Java开源代码十分关注,论文会员在此为大家搜集整理了“ClientAllNewsAction.java”一文,供大家参考学习
package com.org.action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.org.service.*;
import java.util.*;
public class ClientAllNewsAction extends ActionSupport
{
private List news;
private NewsDetailControl newsDetailCtrl;
public void setNewsDetailCtrl(NewsDetailControl newsDetailCtrl)
{
this.newsDetailCtrl = newsDetailCtrl;
}
public String execute() throws Exception
{
Map session = ActionContext.getContext().getSession();
List returnNews=newsDetailCtrl.GetAllNews();
if (returnNews != null && returnNews.size() >= 1)
{
setNews(returnNews);
return SUCCESS;
}
else
{
addActionError("该新闻系统暂时没有记录,等待管理员录入");
return "failure";
}
}
public void setNews(List news)
{
this.news = news;
}
public List getNews()
{
return this.news;
}
}