package com.action;
import java.util.List;
import java.util.Map;
import org.apache.struts2.ServletActionContext;
import com.dao.TGonggaoDAO;
import com.dao.TNewsDAO;
import com.dao.TShipinDAO;
import com.opensymphony.xwork2.ActionSupport;
public class indexAction extends ActionSupport
{
private TNewsDAO newsDAO;
private TShipinDAO shipinDAO;
public String index()
{
Map request=(Map)ServletActionContext.getContext().get("request");
List newsList=newsDAO.findAll();
if(newsList.size()>5)
{
newsList=newsList.subList(0, 5);
}
request.put("newsList", newsList);
String sql="from TShipin where del='no' order by shipinCishu desc";
List shipinList=shipinDAO.getHibernateTemplate().find(sql);
if(shipinList.size()>10)
{
shipinList=shipinList.subList(0, 10);
}
request.put("shipinList", shipinList);
return ActionSupport.SUCCESS;
}
public TNewsDAO getNewsDAO()
{
return newsDAO;
}
public void setNewsDAO(TNewsDAO newsDAO)
{
this.newsDAO = newsDAO;
}
public TShipinDAO getShipinDAO()
{
return shipinDAO;
}
public void setShipinDAO(TShipinDAO shipinDAO)
{
this.shipinDAO = shipinDAO;
}
}
最近下载更多
angaochong LV5
2024年10月21日
wanglinddad LV55
2022年4月1日
ericxu1116 LV24
2021年6月16日
995591560 LV3
2021年6月6日
皓腕凝霜雪 LV2
2021年5月9日
YiRenHun LV11
2021年4月11日
浴皇大帝 LV8
2021年3月22日
jinandfei LV12
2021年3月17日
clwy0617 LV2
2021年2月11日
835512308 LV14
2020年12月20日

最近浏览