1ãæ·»å spring-data-redisçjarå
2ãspringé
ç½®
ï¼1ï¼å¨propertyConfigurerèç¹ä¸æ·»å redis.propertiesé
ç½®
classpath:redis.properties
ï¼2ï¼redisé
ç½®
redis使ç¨ââspringä¸ä½¿ç¨jedisX
3ã代ç æµè¯
import java.io.Serializable;
import java.util.HashMap;
import java.util.LinkedHashMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.data.redis.core.HashOperations;
import org.springframework.data.redis.core.RedisTemplate;
public class JedisTemplateTest {
public static void main(String[] args){
ApplicationContext ctx = new ClassPathXmlApplicationContext(new String[] {'applicationContext.xml'});
RedisTemplate redisTemplate = (RedisTemplate) ContextUtils.getBean('redisTemplate');
HashOperations hashOp
温馨提示:答案为网友推荐,仅供参考