示例#1
0
  /** @return 获取某页音乐的信息 */
  public String queryMusicInfoByPage() {

    // 获取总记录数
    totalRecord = musicBiz.counterByPage();

    // 获取总页数
    totalPage = (totalRecord + limitPage - 1) / limitPage;

    // 当前页处理
    if (nowPage < 1) {
      nowPage = 1;
    } else if (nowPage >= totalPage) {
      nowPage = totalPage;
    }

    // 获得某页的记录
    List<MusicInfo> MusicInfoPage = musicBiz.queryMusicInfoByPage(nowPage, limitPage);

    app.setAttribute("MusicInfoPage", MusicInfoPage);

    int a = 1;
    req.setAttribute("a", a);

    return "queryMusicInfoByPage";
  }
示例#2
0
  /** @return 首页显示分页显示20首歌 */
  public String queryNewMusicByNumberByPage() {
    // 获取总记录数
    totalRecord = musicBiz.counterByPage();
    if (totalRecord > 20) {
      totalRecord = 20; // musicBiz.counterByPage();
    }
    // 获取总页数
    totalPage = (totalRecord + limitPage - 1) / limitPage;

    // 当前页处理
    if (nowPage < 1) {
      nowPage = 1;
    } else if (nowPage >= totalPage) {
      nowPage = totalPage;
    }

    // 获得某页的记录
    List<MusicInfo> allmusicListPage = musicBiz.queryNewMusicByNumberByPage(nowPage, limitPage);
    app.setAttribute("allmusicListPage", allmusicListPage);

    return "queryNewMusicByNumberByPage";
  }