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; } }
最近下载更多
wanglinddad LV54
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日
sunlzh888888 LV28
2020年7月11日
最近浏览更多
sbyhm111
3月14日
暂无贡献等级
ilsfcqdf LV3
1月2日
asddwh LV12
2023年12月26日
蹇金金 LV7
2023年11月7日
shanhaijun123
2023年10月28日
暂无贡献等级
mhymhy123 LV1
2023年10月19日
微信网友_6695766784757760
2023年10月17日
暂无贡献等级
微信网友_6680567232876544 LV8
2023年10月11日
wbx666 LV1
2023年9月18日
husiyu LV3
2023年9月11日