首页
留言板
友链
关于
Search
1
内测“合金弹头”嘿嘿
878 阅读
2
Nginx搭建一个简易的图床
816 阅读
3
Kettle循环遍历结果集作为参数传入转换
792 阅读
4
Apache Dubbo初步认识
426 阅读
5
Maven打包插件与idea
410 阅读
知识库
好奇猫
日常说
笔记本
登录
/
注册
Search
标签搜索
maven
Spring
vue
Java
Java代码
前端
idea
帆软
MySQL
git
CSS
游戏
Bootstrap
生活
网上冲浪
邮件配置
说说
Nginx
Excel
数据库调优
龙流
累计撰写
61
篇文章
累计收到
18
条评论
首页
栏目
知识库
好奇猫
日常说
笔记本
页面
留言板
友链
关于
搜索到
1
篇与
缓存清除
的结果
2022-06-08
java清理缓存实现
前台代码:<script> function CleanConfirm(){ var url="/devindex/function"; var data={f:'clearCache'}; $.ajax({ url: url, type: "post", dataType: "json", contentType: "application/json; charset=utf8", data: data, success: function(data) { if(data.success){ layerInfo(data.msg); }else{ layerInfo(data.msg); } } }); } </script>后台代码:@ResponseBody @RequestMapping({"/function"}) public Map function(String p_dm, @RequestParam Map<String, Object> paramMap, Model model, HttpServletRequest request, HttpServletResponse response) { if ("clearCache".equals(paramMap.get("f"))) { CommonCacheManager commonCacheManager = CommonCacheManager.getCommonCacheManager(); String cacheName = CACHENAME.COMMONAPICONFIG.name(); List<PFunctionsubEntity> pFunctionsubEntities = this.pFunctionSubService.GetOneDataByDm(p_dm); for(int i = 0; i < pFunctionsubEntities.size(); ++i) { PFunctionsubEntity pFunctionsubEntity = (PFunctionsubEntity)pFunctionsubEntities.get(i); commonCacheManager.removeCacheValue(cacheName, pFunctionsubEntity.getId()); commonCacheManager.removeCacheValue(cacheName, pFunctionsubEntity.getDm()); commonCacheManager.removeCacheValue(cacheName, pFunctionsubEntity.getMainid() + pFunctionsubEntity.getDm()); commonCacheManager.removeCacheValue(cacheName, pFunctionsubEntity.getId() + PFunctiontjoptEntity.class.toString()); commonCacheManager.clearCache(pFunctionsubEntity.getDm()); } if (StringUtil.isEmptyOrLength0(p_dm)) { commonCacheManager.clearCache(cacheName); commonCacheManager.clearCache((String)null); } Map resMap = new HashMap(); resMap.put("success", "true"); resMap.put("msg", "clearCache:" + (StringUtil.isEmptyOrLength0(p_dm) ? "all" : p_dm)); return resMap; } }
2022年06月08日
102 阅读
0 评论
0 点赞