我在页面上如下设置:
DWREngine.setMethod(DWREngine.ScriptTag); //跨域设置
DWREngine.setVerb("POST"); //POST
dwr版本是2.0.5
结果发现POST设置好像没用啊,我将跨域代码删除,直接放在服务器上测试,也仅仅能传回很少的数据。大数据量测试,jvm立刻崩溃。。- -
[b]问题补充:[/b]
我的问题不是跨域啊,而是怎么让数据post回来。。
[b]问题补充:[/b]
我就是你说的那样写得。。
刚看了一下文档:Setting the verb is not supported when using ScriptTag remoting.
For example, to set the remoting verb on a global level:
dwr.engine.setHttpVerb("GET");
Or to set it on a call level:
Remote.method(params, {
callback:function(data) { ... },
httpVerb:"GET"
});
Or to set it on a batch level:
dwr.engine.beginBatch();
Remote.method1(params, callback1);
Remote.method2(params, callback2);
dwr.engine.endBatch({
httpVerb:"GET"
});
但是我没用 ScriptTag 让人无法setverb 。目前我只能用get方式返回2K以下数据,大数据只能用xhr_post 方式返回了。