Google Web Toolkit (gwt) - how is the send token generated?

I have a query like:

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| 

I would like to know how gwt generates the md5 value "29F4EA1240F157649C12466F01F46F60"? Is it based on client IP address and date? can anyone point me to the correct code? I just find material regarding the history token, but it looks different.

+4
source share
2 answers

Well, after some research, I think I found the answer.
The keywords you should have looked for are “ strong name ” (or “ strongName ”) and / or permutation , since it seems like with an RPC request, they send a strong perutation name (this hash is MD5), so you can distinguish on the server side from which the request was redirected.
The main function of Util.computeStrongName , it calculates the MD5 hash (d'oh) of the provided byte array with added catch:

 /* * 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. */ 

From there, I tracked the links, and then PermutationResult , which feeds Util.computeStrongName through this function:

 /** * The compiled JavaScript code as UTF8 bytes. */ byte[][] getJs(); 

Eh, I hope this was at least a little useful;) If this still does not answer your question (or you were looking for something else), try trunk/user/src/com/google/gwt/user/client/rpc (start in RpcRequestBuilder.java ).

+3
source

As Igor said, GWT uses MD5 hashes of your application code to create unique names for each permutation of each version of your application. The specific hash that you are referring to is part of the GPC RPC request payload, which identifies the .gwt.rpc serialization policy file on the server. This policy file states which Java objects can be serialized as part of a request, response, or exception in the GPC RPC service.

0
source

Source: https://habr.com/ru/post/1299522/


All Articles