易课寄在线购课系统开发笔记(十五)--完成购课系统门户的工程搭建
生活随笔
收集整理的這篇文章主要介紹了
易课寄在线购课系统开发笔记(十五)--完成购课系统门户的工程搭建
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
購課系統門戶首頁
工程搭建
可以參考
易課寄在線購課系統開發筆記(七)–后臺管理系統工程搭建分析
ecourses-bms-web 工程的搭建過程。
功能分析
請求的 url:/index
web.xml 中的歡迎頁配置:
<welcome-file-list><welcome-file>index.html</welcome-file> </welcome-file-list>http://localhost:8082/index.html
參數:沒有
返回值:String 邏輯視圖
package cn.ecourses.portal.controller; //首頁展示Controller @Controller public class IndexController {@Value("${CONTENT_BIGAD_ID}")private Long CONTENT_BIGAD_ID;@Value("${CONTENT_MINIAD_ID}")private Long CONTENT_MINIAD_ID;@Value("${CONTENT_BESTUP_ID}")private Long CONTENT_BESTUP_ID;@Value("${CONTENT_BESTDOWN_ID}")private Long CONTENT_BESTDOWN_ID;@Value("${CONTENT_CHEAPLEFT_ID}")private Long CONTENT_CHEAPLEFT_ID;@Value("${CONTENT_CHEAPLIST_ID}")private Long CONTENT_CHEAPLIST_ID;@Value("${CONTENT_MINITITLELIST_ID}")private Long CONTENT_MINITITLELIST_ID;@Value("${CONTENT_NEWS_ID}")private Long CONTENT_NEWS_ID;@Autowiredprivate ContentService contentService;@RequestMapping("/index")public String showIndex(Model model) {//查詢內容列表List<EcoursesContent> bigAdList = contentService.getContentListByCid(CONTENT_BIGAD_ID);List<EcoursesContent> smallAdList = contentService.getContentListByCid(CONTENT_MINIAD_ID);List<EcoursesContent> bestUpList = contentService.getContentListByCid(CONTENT_BESTUP_ID);List<EcoursesContent> bestDownList = contentService.getContentListByCid(CONTENT_BESTDOWN_ID);List<EcoursesContent> cheapLeftList = contentService.getContentListByCid(CONTENT_CHEAPLEFT_ID);List<EcoursesContent> cheapList = contentService.getContentListByCid(CONTENT_CHEAPLIST_ID);List<EcoursesContent> miniTitleList = contentService.getContentListByCid(CONTENT_MINITITLELIST_ID);List<EcoursesContent> newsList = contentService.getContentListByCid(CONTENT_NEWS_ID);// 把結果傳遞給頁面model.addAttribute("bigAdList", bigAdList);model.addAttribute("smallAdList", smallAdList);model.addAttribute("bestUpList", bestUpList);model.addAttribute("bestDownList", bestDownList);model.addAttribute("cheapLeftList", cheapLeftList);model.addAttribute("cheapList", cheapList);model.addAttribute("miniTitleList", miniTitleList);model.addAttribute("newsList", newsList);return "index";} }總結
以上是生活随笔為你收集整理的易课寄在线购课系统开发笔记(十五)--完成购课系统门户的工程搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: zynq-7000移植linux操作系统
- 下一篇: 国产高性能32位M0内核MCU单片机DP