• 大小: 43KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-18
  • 语言: 其他
  • 标签: redis分页  jedis  redis  

资源简介

只要你的redis已经准备好即可。该项目需要maven依赖,请自行安装maven。然后把redis的链接地址改一下,用tomcat发布项目之后,进入项目:浏览器地址栏输入http://localhost:8080/ProjectRedis/mvc/news/query?current=1即可进入项目后面的current代表了分页【开始进入时没有数据,在首页进行添加即可】

资源截图

代码片段和文件信息

package com.libo.controller;

import java.util.Map;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.libo.po.News;
import com.libo.service.NewsService;
import com.libo.util.Util;

@Controller
@RequestMapping(“news“)
public class NewsController {
@Autowired
NewsService newsService;
@RequestMapping(“query“)
public String query(Long currentModel m){
current=current==null?1:current;
List> maps=newsService.query(current Util.pageSize);
m.addAttribute(“list“ maps);
return “/index.jsp“;
}
@RequestMapping(“save“)
public String save(News news){
boolean flag=newsService.saveOrUpdate(news);
return “redirect:/mvc/news/query“;
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-08-08 17:08  ProjectRedis\
     文件        1317  2017-08-03 10:50  ProjectRedis\.classpath
     文件        1721  2017-08-03 10:50  ProjectRedis\.project
     目录           0  2017-08-08 17:08  ProjectRedis\.settings\
     文件         597  2017-08-02 11:08  ProjectRedis\.settings\.jsdtscope
     文件         108  2017-08-03 09:26  ProjectRedis\.settings\com.genuitec.runtime.libraries.xml
     文件         191  2017-08-02 11:08  ProjectRedis\.settings\org.eclipse.core.resources.prefs
     文件         430  2017-08-02 11:08  ProjectRedis\.settings\org.eclipse.jdt.core.prefs
     文件          90  2017-08-02 11:08  ProjectRedis\.settings\org.eclipse.m2e.core.prefs
     文件         678  2017-08-02 11:10  ProjectRedis\.settings\org.eclipse.wst.common.component
     文件         161  2017-08-03 09:26  ProjectRedis\.settings\org.eclipse.wst.common.project.facet.core.prefs.xml
     文件         450  2017-08-03 09:26  ProjectRedis\.settings\org.eclipse.wst.common.project.facet.core.xml
     文件          49  2017-08-02 11:08  ProjectRedis\.settings\org.eclipse.wst.jsdt.ui.superType.container
     文件           6  2017-08-02 11:08  ProjectRedis\.settings\org.eclipse.wst.jsdt.ui.superType.name
     文件         422  2017-08-03 09:26  ProjectRedis\.springBeans
     目录           0  2017-08-08 17:08  ProjectRedis\build\
     目录           0  2017-08-08 17:08  ProjectRedis\build\classes\
     文件        2307  2017-08-08 17:05  ProjectRedis\pom.xml
     目录           0  2017-08-08 17:08  ProjectRedis\src\
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\
     文件        1833  2017-08-03 10:42  ProjectRedis\src\main\java\beans.xml
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\libo\
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\libo\controller\
     文件         903  2017-08-03 10:51  ProjectRedis\src\main\java\com\libo\controller\NewsController.java
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\libo\dao\
     文件         279  2017-08-03 10:07  ProjectRedis\src\main\java\com\libo\dao\NewsDao.java
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\libo\dao\impl\
     文件        2927  2017-08-03 10:55  ProjectRedis\src\main\java\com\libo\dao\impl\NewsDaoImpl.java
     目录           0  2017-08-08 17:08  ProjectRedis\src\main\java\com\libo\demo\
............此处省略57个文件信息

评论

共有 条评论