????????????????????ū?????γ?????η????????????????

??????????????????Щ???????????

????????post????

function getResult(script?? method?? paras){
 var typelist = []
 for(var i = 0; i < paras.length; i++){
  typelist.push(typeof(paras[i]))
 }
 var result = "" + engine.getResult(script?? method?? paras?? typelist)
        return result
}
..............
public String getResult(String ScriptName?? String MethodName?? Object[] args??
String[] argsTypes) throws Exception{
 String posturl = http://xxxxxxxxxxxxxxxx/dwr/call/plaincall/ + ScriptName + MethodName +".dwr";
 StringBuffer paramBuffer = new StringBuffer();
 paramBuffer.append("callCount=1 scriptSessionId=${scriptSessionId}187 ");
 paramBuffer.append("c0-scriptName=").append(ScriptName).append(" c0-methodName=").append(MethodName);
 paramBuffer.append(" c0-id=0");

 for(int i=0;i<args.length;i++){
  paramBuffer.append(" c0-param").append(i).append("=").append(argsTypes[i]).append(":").append(args[i]);
 }
 paramBuffer.append(" batchId=889209 ");
 return post(posturl?? paramBuffer.toString());
}

??????????????????????????js??????java???棬??sun.org.mozilla.javascript.internal.NativeObject??????????js?????????????java????

public static HashMap<String?? Object> getResult(String dwrString) throws Exception{
 ScriptEngineManager manager = new ScriptEngineManager();
 ScriptEngine engine = manager.getEngineByName("js");
 HashMap<String?? Object> retMap = new HashMap<String?? Object>();
 engine.put("inputString"?? dwrString);
 engine.put("map"?? retMap);
 String jsScriptString = "" +
   "var re = new RegExp("dwr.engine._remoteHandleCallback\\('\\d+'??'\\d+'??(.*?)\\);"?? "m") " +
   "var value = inputString.replace(re?? "var __result__ = $1") " +
   "eval(value) " +
   "for(var k in __result__) { map.put(k?? __result__[k])}";
 engine.eval(jsScriptString);
 return retMap;

}

public static void justtest(String testString) throws Exception{
 HashMap<String?? Object> map = getResult(testString);

 Double albumId = (Double) map.get("albumId");
 System.out.println("albumId : " + albumId.intValue());
 
 NativeObject album = (NativeObject) (map.get("album"));
 System.out.println("album.createTime : " + album.get("createTime"?? null));
 System.out.println("album.curl : " + album.get("curl"?? null));

}