当前位置: 首页 > news >正文

阳泉营销型网站建设费用印度做网站

阳泉营销型网站建设费用,印度做网站,如何自己做引流推广,死链接对网站的危害有哪些1#xff0c;配置pom文件#xff0c;引入相应资源文件 2#xff0c;配置application.properties#xff0c;如果springboot版本差别太大#xff0c;配置中的属性名会有不同#xff0c;请注意修改。 #redis配置 # Redis数据库索引#xff08;默认为0#xff09; spri…1配置pom文件引入相应资源文件 2配置application.properties如果springboot版本差别太大配置中的属性名会有不同请注意修改。 #redis配置   # Redis数据库索引默认为0 spring.redis.database0 # Redis服务器地址 spring.redis.host127.0.0.1 # Redis服务器连接端口 spring.redis.port6379 # Redis服务器连接密码默认为空 spring.redis.password # 连接池最大连接数 spring.redis.jedis.pool.max-active100 # 连接池中的最大空闲连接 spring.redis.jedis.pool.max-idle20 # 连接池中的最小空闲连接 spring.redis.jedis.pool.min-idle5 # 连接超时时间毫秒 spring.redis.timeout1000 #spring-session 使用 spring.session.store-typenone 3添加RedisConfig的工厂类 import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Value; import org.springframework.cache.annotation.CachingConfigurerSupport; import org.springframework.context.annotation.Configuration; import redis.clients.jedis.JedisPool; import redis.clients.jedis.JedisPoolConfig;   Configuration public class RedisConfig extends CachingConfigurerSupport {       protected static final Logger logger Logger.getLogger(RedisConfig.class);       Value(${spring.redis.host})     private String host;       Value(${spring.redis.port})     private int port;       Value(${spring.redis.jedis.pool.max-active})     private int maxTotal;       Value(${spring.redis.jedis.pool.max-idle})     private int maxIdle;       Value(${spring.redis.jedis.pool.min-idle})     private int minIdle;       Value(${spring.redis.password})     private String password;       Value(${spring.redis.timeout})     private int timeout;       public JedisPool redisPoolFactory() {         JedisPoolConfig jedisPoolConfig new JedisPoolConfig();         jedisPoolConfig.setMaxTotal(maxTotal);         jedisPoolConfig.setMaxIdle(maxIdle);         jedisPoolConfig.setMinIdle(minIdle);         JedisPool jedisPool new JedisPool(jedisPoolConfig, host, port, timeout, null);         logger.info(JedisPool注入成功);         logger.info(redis地址 host : port);         return jedisPool;     } } 4添加工具类 import com.wx.config.RedisConfig; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import redis.clients.jedis.Jedis; import redis.clients.jedis.JedisPool;   import javax.annotation.PostConstruct;     /**  * Date:2019-07_08 13:20  * Description: redis 工具类  */ Component public class RedisUtils {       protected static final Logger logger Logger.getLogger(RedisUtils.class);       private static JedisPool jedisPool;       Autowired     private RedisConfig redisConfig;       /**      * JedisPool 无法通过Autowired注入可能由于是方法bean的原因此处可以先注入RedisConfig      * 然后通过PostConstruct初始化的时候将factory直接赋给jedisPool      */     PostConstruct     public void init() {         jedisPool redisConfig.redisPoolFactory();     }       public static String get(String key, int indexdb) {         Jedis jedis null;         String value null;           try {             jedis jedisPool.getResource();//获取一个jedis实例             jedis.select(indexdb);             value jedis.get(key);         } catch (Exception e) {             logger.error(错误日志e.getMessage());         } finally {             jedis.close();         }         return value;     } } 5添加测试方法 GetMapping(value /test)     public String test(){         String str RedisUtils.get(test,0);         System.out.println(str**************);         return str;     }
http://www.zqtcl.cn/news/370372/

相关文章:

  • 机床网站建设网站关键词优化怎么做
  • 全网营销一站式推广wordpress新文章加new
  • 做网站哪个系统最安全长沙简界网络科技有限公司
  • 象山县城乡和住房建设局网站上海公司牌照最新价格
  • 复旦学霸张立勇做的网站开一个公司需要多少钱
  • 专业建设公司网站软件技术培训
  • 网站建设_聊城笑话小网站模板html
  • 智能建造师威海网站优化推广
  • 做网站如何选域名长沙房价2020最新价格
  • seo网站推广济宁一建建设集团有限公司
  • 高端大气网站设计欣赏有意思网站推荐
  • 什么网站做海宁的房产好北控京奥建设有限公司网站
  • 上海网站建设网络推广网页搜索框下记录删不掉
  • 团购网站大全做相册手机网站如何制作免费
  • 承德网站制作方案百度seo关键词排名s
  • 网站建设公司佛山国内网站推广
  • 辽宁网站制作公司潍坊网站建设维护
  • 手机网站图片切换平面图网站
  • 松岗建设网站广州网站定制开发方案
  • 东阳网站建设价格做理财的网站有哪些问题
  • 蓄电池回收网站建设wordpress cp 部署
  • cuteftp 备份网站网站制作课程介绍
  • 杭州网站搭建宁波企业官网建设
  • php免费网站源码网站建设电子书
  • 建设纺织原料网站专业网页制作室
  • 买域名做网站推广都是些什么湘潭什么网站做c1题目
  • 鲜花网站建设图片昆明网站建站平台
  • 密云网站制作案例昆明小程序开发
  • 网站紧急维护商丘手机网站制作
  • 什么专业会制作网站罗湖做网站的公司哪家好