dwr+servlet跨域问题,解决完发红包10元

目前dwr项目部署在119.10.55.134服务器上,但是由于需要,需要在另一台服务器去访问119.10.55.134服务器上的dwr资源,以及119.10.55.134服务器的dwr也需要对访问的客户端作出推送。
但是在客户端调用服务器时,浏览器的firebug报错了。
XMLHttpRequest cannot load file:///C:/isoftforce/interact/call/plaincall/__System.generateId.dwr. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
send @ engine.js:1701
send2 @ engine.js:1571
send @ engine.js:1531
dwr.engine.endBatch @ engine.js:295
dwr.engine._execute @ engine.js:704
p.say @ interaction.js:14
sendMessage @ common.js:134
handler @ common.js:111
onClick @ ext-all.js:14
C @ ext-all.js:7
engine.js:994 console.trace
dwr.engine._debug @ engine.js:994
dwr.engine.defaultErrorHandler @ engine.js:231
(anonymous) @ engine.js:804
logHandlerEx @ engine.js:2563
(anonymous) @ engine.js:801
ignoreIfUnloading @ engine.js:617
dwr.engine._handleError @ engine.js:782
validate @ engine.js:2455
complete @ engine.js:1578
stateChange @ engine.js:1806
batch.req.onreadystatechange @ engine.js:1674
send @ engine.js:1701
send2 @ engine.js:1571
send @ engine.js:1531
dwr.engine.endBatch @ engine.js:295
dwr.engine._execute @ engine.js:704
p.say @ interaction.js:14
sendMessage @ common.js:134
handler @ common.js:111
onClick @ ext-all.js:14
C @ ext-all.js:7
engine.js:995
Error: dwr.engine.incompleteReply, Incomplete reply from server

查了好多资料修改也不好使,跪求大侠帮帮忙。

1个回答

两种办法:
一:客户端访问当前域的服务,在服务中建立拦截器是dwr的服务,重定向到134服务器服务

二:使用nignx

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐