我有这样的要求
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|
我想知道 GWT 如何生成 md5 值
29F4EA1240F157649C12466F01F46F60
?是基于客户端IP和日期吗?谁能指出我正确的代码?我只是找到有关历史 token 的东西,但这对我来说看起来不一样。
最佳答案
好的,经过一番研究,我想我找到了答案。
您应该寻找的关键字是“ 强名称 ”(或“ 强名称 ”)和/或 排列 ,因为它们似乎在 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.
*/
从那里,我追溯到 linkers然后到 PermutationResult正在喂食
Util.computeStrongName
通过这个功能:/**
* The compiled JavaScript code as UTF8 bytes.
*/
byte[][] getJs();
嗯,我希望这至少有点帮助 ;) 如果这仍然不能回答您的问题(或者您正在寻找不同的东西),请尝试
trunk/user/src/com/google/gwt/user/client/rpc
(从 RpcRequestBuilder.java 开始)。
关于gwt - GWT中的post token是如何生成的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2145616/