如何在GWT中生成帖子令牌?

sve*_*ven 5 gwt post md5 token

我有类似的要求

5|0|7|http://localhost:8080/testproject/|29F4EA1240F157649C12466F01F46F60|com.test.client.GreetingService|greetServer|java.lang.String|myInput1|myInput2|1|2|3|4|2|5|5|6|7|
Run Code Online (Sandbox Code Playgroud)

我想知道GWT如何生成md5值29F4EA1240F157649C12466F01F46F60?它基于客户端的ip和日期吗?谁能指出我正确的代码?我只是找到有关历史令牌的内容,但这对我来说似乎有所不同。

Igo*_*mer 3

好吧,经过一番研究,我想我找到了答案。
您应该寻找的关键字是“强名称”(或“ strongName ”)和/或排列,因为似乎通过RPC请求,它们发送出排列强名称(即MD5哈希值),这样您就可以在服务器端区分请求是从哪个排列发送的。
核心函数是Util.computeStrongName,它计算所提供的字节数组的 MD5 哈希值(d'oh),并添加了以下内容:

/*
 * Include the lengths of the contents components in the hash, so that the
 * hashed sequence of bytes is in a one-to-one correspondence with the
 * possible arguments to this method.
 */
Run Code Online (Sandbox Code Playgroud)

从那里,我追踪到链接器,然后追踪到通过此函数提供的PermutationResult :Util.computeStrongName

/**
 * The compiled JavaScript code as UTF8 bytes.
 */
byte[][] getJs();
Run Code Online (Sandbox Code Playgroud)

呃,我希望这至少有点帮助;)如果这仍然不能回答您的问题(或者您正在寻找不同的东西),请尝试(从RpcRequestBuilder.javatrunk/user/src/com/google/gwt/user/client/rpc开始)。