自定义工具类
String cache_key="abc";
//工具类
MemcachedCache cache = new MemcachedCache();
存入
List<Object> list=new ArrayList<Object>();
org.json.JSONArray json=new org.json.JSONArray(list);
cache.put(cache_key, json.toString(),60);
取出
List<Ojbect> list = (List<Ojbect>) net.sf.json.JSONArray.fromObject(cache_key);
注意:去除的List<Object>对象中的Date变量取出的是java.lang.String类型,页面使用<c:>标签或者<fmt>标签转换时会失败,需要手写js脚本自己转换格式
//js脚本
function formatStringToDate(s){
var d = new Date(s);
var resDate = d.getFullYear() + '-' + (d.getMonth() + 1) + '-' + d.getDate();
return resDate;
}