• 大小: 21.82MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-04
  • 语言: 其他
  • 标签: redis  缓存  demo  

资源简介

在SSH框架中使用Redis作为hibernate的二级缓存的demo,仅用作参考

资源截图

代码片段和文件信息

package com.pan.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

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

import com.pan.entity.User;
import com.pan.service.baseService;

@Controller
@RequestMapping(value=“/user“)
public class UserController {
@Autowired
private baseService baseService;

@RequestMapping(value=“add.action“)
@ResponseBody
public String addUser(HttpServletRequest requestHttpServletResponse response){
User user = new User();
user.setUsername(“pan“);
baseService.saveEntity(user);
return “success“;
}

@RequestMapping(value=“get.action“)
@ResponseBody
public String getUsers(HttpServletRequest requestHttpServletResponse response){
return baseService.findEntities(User.class).toString();
}
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        879  2018-03-21 14:59  RedisDemo\.classpath

     文件       1042  2018-03-26 09:27  RedisDemo\.project

     文件        567  2018-03-21 14:27  RedisDemo\.settings\.jsdtscope

     文件        364  2018-03-21 14:27  RedisDemo\.settings\org.eclipse.jdt.core.prefs

     文件        552  2018-03-26 09:27  RedisDemo\.settings\org.eclipse.wst.common.component

     文件        345  2018-03-21 14:27  RedisDemo\.settings\org.eclipse.wst.common.project.facet.core.xml

     文件         49  2018-03-21 14:27  RedisDemo\.settings\org.eclipse.wst.jsdt.ui.superType.container

     文件          6  2018-03-21 14:27  RedisDemo\.settings\org.eclipse.wst.jsdt.ui.superType.name

     文件       4833  2018-03-28 15:24  RedisDemo\build\classes\applicationContext.xml

     文件       1507  2018-03-30 14:58  RedisDemo\build\classes\com\pan\controller\UserController.class

     文件        342  2018-03-30 14:58  RedisDemo\build\classes\com\pan\dao\baseDao.class

     文件       1895  2018-03-30 14:58  RedisDemo\build\classes\com\pan\daoImpl\baseDaoImpl.class

     文件       2090  2018-03-30 14:58  RedisDemo\build\classes\com\pan\entity\User.class

     文件        354  2018-03-30 14:58  RedisDemo\build\classes\com\pan\service\baseService.class

     文件        119  2018-03-30 14:58  RedisDemo\build\classes\com\pan\service\UserService.class

     文件       1141  2018-03-30 14:58  RedisDemo\build\classes\com\pan\serviceImpl\baseServiceImpl.class

     文件        455  2018-03-30 14:58  RedisDemo\build\classes\com\pan\serviceImpl\UserServiceImpl.class

     文件       1079  2018-03-30 14:58  RedisDemo\build\classes\com\pan\test\AA.class

     文件       1835  2018-03-30 14:58  RedisDemo\build\classes\com\pan\test\YamlTest.class

     文件        479  2018-03-26 10:24  RedisDemo\build\classes\hibernate-redis.properties

     文件        300  2018-03-22 09:55  RedisDemo\build\classes\jdbc.properties

     文件        247  2018-03-26 14:16  RedisDemo\build\classes\log4j.properties

     文件        768  2018-03-26 15:40  RedisDemo\build\classes\redisson.yaml

     文件       1427  2018-03-22 10:07  RedisDemo\build\classes\springmvc.xml

     文件       4833  2018-03-28 15:24  RedisDemo\config\applicationContext.xml

     文件        479  2018-03-26 10:24  RedisDemo\config\hibernate-redis.properties

     文件        300  2018-03-22 09:55  RedisDemo\config\jdbc.properties

     文件        247  2018-03-26 14:16  RedisDemo\config\log4j.properties

     文件        768  2018-03-26 15:40  RedisDemo\config\redisson.yaml

     文件       1427  2018-03-22 10:07  RedisDemo\config\springmvc.xml

............此处省略94个文件信息

评论

共有 条评论