这里用了fastjson来解析json
package com.tntxia.geography.util; import java.util.Map; import com.alibaba.fastjson.JSON; public class JSONPParser { public static Map parseJSONP(String jsonp){ int startIndex = jsonp.indexOf("("); int endIndex = jsonp.lastIndexOf(")"); String json = jsonp.substring(startIndex+1, endIndex); System.out.println(json); return JSON.parseObject(json); } public static void main(String[] args){ Map map = parseJSONP("jsonp_test({})"); } }