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

如何做移动支付网站于都网站建设

如何做移动支付网站,于都网站建设,网站使用支付接口如何收费,中国贸易信息网我最近在博客中谈论有关Spring 3.1及其新的缓存注释Cacheable和CacheEvict 。 与所有Spring功能一样#xff0c;您需要进行一定数量的设置#xff0c;并且通常使用Spring的XML配置文件来完成。 在缓存的情况下#xff0c;打开Cacheable和CacheEvict并不容易#xff0c;因为… 我最近在博客中谈论有关Spring 3.1及其新的缓存注释Cacheable和CacheEvict 。 与所有Spring功能一样您需要进行一定数量的设置并且通常使用Spring的XML配置文件来完成。 在缓存的情况下打开Cacheable和CacheEvict并不容易因为您要做的就是将以下内容添加到Spring配置文件中 cache:annotation-driven / …以及您的beans XML元素声明中的适当模式定义 beans xmlnshttp://www.springframework.org/schema/beans xmlns:phttp://www.springframework.org/schema/pxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:cachehttp://www.springframework.org/schema/cache xmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/contexthttp://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/cachehttp://www.springframework.org/schema/cache/spring-cache.xsd …的主要特点是 xmlns:cachehttp://www.springframework.org/schema/cache …和 http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd 但是这还不是故事的结局因为您还需要指定一个缓存管理器和一个缓存实现。 好消息是如果您熟悉其他Spring组件例如数据库事务管理器的设置那么这样做的方式就不足为奇了。 缓存管理器类似乎是实现Spring的org.springframework.cache.CacheManager接口的任何类。 它负责管理一个或多个缓存实施其中缓存实施实例负责实际缓存数据。 下面的XML示例摘自我最近两个博客中使用的示例代码。 bean idcacheManager classorg.springframework.cache.support.SimpleCacheManagerproperty namecachessetbeanclassorg.springframework.cache.concurrent.ConcurrentMapCacheFactoryBeanp:nameemployee/!-- TODO Add other cache instances in here--/set/property /bean 在上面的配置中我使用Spring的SimpleCacheManager来管理其ConcurrentMapCacheFactoryBean实例该实例的缓存实现名为“ employee ”。 需要注意的重要一点是您的缓存管理器必须具有cacheManager 。 如果您弄错了那么将得到以下异常 org.springframework.beans.factory.BeanCreationException: Error creating bean with name org.springframework.cache.interceptor.CacheInterceptor#0: Cannot resolve reference to bean cacheManager while setting bean property cacheManager; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named cacheManager is definedat org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveReference(BeanDefinitionValueResolver.java:328)at org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. populateBean(AbstractAutowireCapableBeanFactory.java:1118)at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory. doCreateBean(AbstractAutowireCapableBeanFactory.java:517) : : trace details removed for clarity :at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. runTests(RemoteTestRunner.java:683)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. run(RemoteTestRunner.java:390)at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. main(RemoteTestRunner.java:197) Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named cacheManager is definedat org.springframework.beans.factory.support.DefaultListableBeanFactory. getBeanDefinition(DefaultListableBeanFactory.java:553)at org.springframework.beans.factory.support.AbstractBeanFactory. getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095)at org.springframework.beans.factory.support.AbstractBeanFactory. doGetBean(AbstractBeanFactory.java:277)at org.springframework.beans.factory.support.AbstractBeanFactory. getBean(AbstractBeanFactory.java:193)at org.springframework.beans.factory.support.BeanDefinitionValueResolver. resolveReference(BeanDefinitionValueResolver.java:322) 就像我在上面说的那样在我的简单配置中整个工作由SimpleCacheManager协调。 根据文档这通常是“用于测试或简单的缓存声明”。 尽管您可以编写自己的CacheManager实现但Spring的专家们为不同情况提供了其他缓存管理器 SimpleCacheManager –参见上文。 NoOpCacheManager –用于测试因为它实际上并不缓存任何内容尽管在这里要小心因为在不进行缓存的情况下测试代码可能会在打开缓存时使您绊倒。 CompositeCacheManager –允许在单个应用程序中使用多个缓存管理器。 EhCacheCacheManager –包装ehCache实例的缓存管理器。 见http://ehcache.org 对于Spring Profile选择在任何给定环境中使用哪个缓存管理器似乎是一个很好的用途。 看到 在XML Config中使用Spring配置文件 使用Spring Profiles和Java配置 而且尽管只是为了完整起见但这只是将内容整理一下下面是我前两个博客中使用的完整配置文件 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beans xmlns:phttp://www.springframework.org/schema/pxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:cachehttp://www.springframework.org/schema/cache xmlns:contexthttp://www.springframework.org/schema/contextxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsdhttp://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsdhttp://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd!-- Switch on the Caching --cache:annotation-driven /!-- Do the component scan path --context:component-scan base-packagecaching /!-- simple cache manager --bean idcacheManager classorg.springframework.cache.support.SimpleCacheManagerproperty namecachessetbean classorg.springframework.cache.concurrent.ConcurrentMapCacheFactoryBean p:nameemployee/!-- TODO Add other cache instances in here--/set/property/bean/beans 正如哥伦波中尉喜欢说“还有一件事你知道让我为这个案件烦恼……” 好吧关于缓存管理器有几件事让我感到困扰例如 在谈论SimpleCacheManager时Spring的家伙们所说的“对测试或简单的缓存声明有用”是什么意思 您究竟应该何时愤怒地使用它而不是进行测试 最好编写自己的CacheManager实现甚至是Cache实现吗 使用EhCacheCacheManager确切优势是什么 您真正需要多少时间CompositeCacheManager 我将来可能会研究所有这些…… 祝您编程愉快别忘了分享 参考来自Captain Debugs Blog博客的JCG合作伙伴 Roger Hughes的Spring 3.1 Caching and Config 。 翻译自: https://www.javacodegeeks.com/2012/09/spring-31-caching-and-config.html
http://www.pierceye.com/news/378621/

相关文章:

  • 怎样登录建设互联网站厦门海绵城市建设官方网站
  • 网站怎么做权重互联网平台推广怎么做
  • 网站建设如果登录失败男生和男生做污的视频网站
  • 备案ip 查询网站查询系统制作一个网站的成本
  • 微网站排版p9制作公司
  • 国产在线免费观看高甜电影推荐爱站网seo工具包
  • 建设银行官方网站首页入口建立网站如何推广
  • 网站登录界面图片用什么软件做wordpress qiniu
  • 设计素材网站好融资吗关键词排名怎么做好
  • 亚洲购物网站排名网站开发看掉一些功能
  • 网站开发 需求dnf盗号网站怎么做
  • 淘宝客免费网站建设宝塔搭建wordpress主机地址
  • 可以看网站的浏览器wordpress+博客+简书
  • 游戏源码网站免费网站模板有哪些内容
  • 江西网站优化广东网站设计有名的公司
  • wordpress整合dplayer关键词优化举例
  • wordpress怎么设置跳站外链接番禺网站建设培训学校
  • 怎样建立网站平台新网站应该怎么做
  • 根据颜色找网站济南做网站公司排名
  • 面对面视频 网站开发网络科技加我qq是干嘛
  • 如何登录网站制作平台百度旧版本
  • 广东营销型网站建设报价定制商品的app
  • 网站导航常用关键字电子商务网站设计内容
  • 建设vip网站相关视频wordpress 修改用户头像
  • 考百度指数 某个关键词在某个行业网站上的wordpress与Wix对比
  • 机器人网站建设规划书福州网站制作怎样
  • 自己创建一个网站需要多少钱2023最建议买10款手机
  • 寻找富阳网站建设国内个人网站欣赏
  • 企业自建站城市建设模拟游戏官方网站
  • 网站建设数据库类型建立网站信息发布登记制度