Getting com.google.gwt.user.client.rpc.StatusCodeException: 0 in GWT

前端 未结 4 610
清酒与你
清酒与你 2021-02-14 21:29

I sometimes/often get this Exception in GWT but don\'t know why:

SEVERE: com.google.gwt.user.client.rpc.StatusCodeException: 0 
java.lang.RuntimeException: com.g         


        
4条回答
  •  悲&欢浪女
    2021-02-14 21:37

    Although the original poster probably had issues with their network connection I got the same error today inside GWT hosted mode. And not sometimes, but all the time.

    I have now figured it out, and I'd like to share it here so other people searching for a sollution to the 0 status code problem can find it.

    If you use the Rpc security tokens that GWT provides (as in this explanation: http://www.gwtproject.org/doc/latest/DevGuideSecurityRpcXsrf.html) against cross site scripting but you forget to set the security token for whatever reason then one of the things you might run into is the zero result.

    I've designed my webapplication so that most RPC calls are mostly made within a framework. Today I needed to create an RPC service by hand. Forgot to set the RPCToken, got empty response from the server.

    Hope this helps somebody out.

自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题