小邓你好

001:android 通知
http://tonysun3544.iteye.com/blog/1273055

00.支付宝:
http://programer-wf.iteye.com/blog/682694
0.电商平台方案:
http://wenku.baidu.com/view/85950a09bb68a98271fefa68.html

1.百度地图api:
http://api.map.baidu.com/lbsapi/creatmap/

2.IP:
http://www.dns001.com/tech/content-37-35519-1.html
http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js

3.Struts2 获得request session
ServletActionContext.getRequest();

spring
HttpServletRequest session = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest().getSession();  






public String convertToString(Object o,String dateFormat)
{
JsonConfig config = new JsonConfig();
config.registerJsonValueProcessor(Date.class, new DateJsonValueProcessor(dateFormat));
if(o.getClass().isArray()||List.class.isAssignableFrom(o.getClass()))
{
return JSONArray.fromObject(o,config).toString();
}
else
{
return JSONObject.fromObject(o, config).toString();
}
}


import java.text.SimpleDateFormat;
import java.util.Date;

import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;


public class DateJsonValueProcessor implements JsonValueProcessor {

private SimpleDateFormat sdf = null;
public DateJsonValueProcessor(String dateFormat)
{
this.sdf = new SimpleDateFormat(dateFormat);
}
public Object processArrayValue(Object value, JsonConfig config) {
if (value == null) { 
            return ""; 
        } else { 
            return sdf.format((Date) value); 
        } 
}

public Object processObjectValue(String key, Object value, JsonConfig config) {
if (value == null) { 
            return ""; 
        } else { 
            return sdf.format((Date) value); 
        } 
}

}

你可能感兴趣的:(小邓你好)