首页>代码>java SSH框架开发毕业设计-湖南科技大学资源分享系统,数据库mysql5.5,DIV+CSS布局>/Research/src/com/hnust/research/action/HomeAction.java
package com.hnust.research.action; import java.util.ArrayList; import java.util.List; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Controller; import com.hnust.research.base.BaseAction; import com.hnust.research.domain.Competition; import com.hnust.research.domain.Label; import com.hnust.research.domain.Notice; import com.hnust.research.domain.ProgLanguage; import com.hnust.research.domain.Source; import com.hnust.research.domain.User; import com.opensymphony.xwork2.ActionContext; @Controller @Scope("prototype") public class HomeAction extends BaseAction<User>{ //返回主页 public String index() throws Exception{ /** * 准备数据 */ List<Label> labelList=new ArrayList<Label>(); List<ProgLanguage> languageList=new ArrayList<ProgLanguage>(); List<Source> top10List=new ArrayList<Source>(); List<Source> latestShareList=new ArrayList<Source>(); List<Source> recommendList=new ArrayList<Source>(); List<User> latestUsersList=new ArrayList<User>(); List<User> mostUploadUsersList=new ArrayList<User>(); List<Notice> noticeList=new ArrayList<Notice>(); List<Competition> competitionList=new ArrayList<Competition>(); labelList=labelService.findAll(); languageList=progLanguageService.findAll(); top10List=sourceService.getTop10(); latestShareList=sourceService.getLatest(6);//获取最新前六 recommendList=sourceService.getRecommand(6);//获取前六 latestUsersList=userService.getLatestUsers(6);//获得最近6个加入者 mostUploadUsersList=userService.getMostUploadUsers(6); //获得最多上传前六位 noticeList=noticeService.getList(5);//获得最近5条公告 competitionList=competitionService.getList(5); //获得最近五个比赛 ActionContext.getContext().put("labelList", labelList); ActionContext.getContext().put("languageList", languageList); ActionContext.getContext().put("top10List", top10List); ActionContext.getContext().put("latestShareList", latestShareList); ActionContext.getContext().put("recommendList", recommendList); ActionContext.getContext().put("latestUsersList", latestUsersList); ActionContext.getContext().put("mostUploadUsersList", mostUploadUsersList); ActionContext.getContext().put("noticeList", noticeList); ActionContext.getContext().put("competitionList", competitionList); return "index"; } }
最近下载更多
ziv5466123 LV7
2023年12月15日
xuweiwowzy LV5
2023年7月30日
wanglei92 LV2
2023年6月26日
hosinvm LV7
2022年11月18日
123456781 LV4
2022年7月13日
二十一画 LV10
2022年6月25日
微信网友_5963854197018624 LV7
2022年5月21日
buchifanqie LV2
2022年3月22日
八云橙 LV1
2022年3月8日
行家文化 LV1
2022年2月8日
最近浏览更多
12345644
昨天
暂无贡献等级
zolscy LV12
昨天
15103432984 LV2
3月17日
1203093322
2023年12月31日
暂无贡献等级
ziv5466123 LV7
2023年12月15日
2010160433 LV3
2023年11月30日
空中飞尘 LV13
2023年11月25日
1waxzsq212345 LV2
2023年11月22日
Henew168 LV2
2023年11月19日
去码头整点薯条 LV3
2023年11月15日