Hello there!
Our development environment has client code and server code. Client
side we are using GWT(GXT) and server side we are using RESTFul
(Apache CXF) services. And the communication between client and server
is via JSON. Also we need to maintain token for login user. Everything
runs fine is run time environment as a single deployment. But in debug
(development) we have to simulate the client side and server side.
While invoking the RESTFul URL, we need to pass jsessionid along with
request to bind this request to existing user session. I have tried
two options but both are not working
1) Placing jsessionid in url
url.append('?');
url.append("JSESSIONID=40E882AB5352F4607115027F2CDDB8C1&");
2) Setting cookie using Cookie api.
RequestBuilder requestBuilder = new RequestBuilder(method,
getURL(method, getUIServiceEndPoint() + resource, pageConfig));
requestBuilder.setHeader("Content-Type", "application/json;
charset=utf-8");
requestBuilder.setHeader("Accept", "application/json;
charset=utf-8");
Date now = new Date();
long nowLong = now.getTime();
nowLong = nowLong + (1000 * 60 * 60 * 24 * 7);//seven days
now.setTime(nowLong);
Cookies.setCookie("JSESSIONID",
"5C05A78C5DC2AE6C891A0338F33F90ED", now);
Server log does not show anything related to jsessionid when these two
approaches are used.
ID: 2
Address: /abc/REST/services/xyz
Encoding: UTF-8
Content-Type:
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
accept-language=[en-us,en;q=0.5], host=[localhost:8084], accept-
charset=[ISO-8859-1,utf-8;q=0.7,*;q=0.7], user-agent=[Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100504
Firefox/3.5.10], Content-Type=[null], Accept=[text/html,application/
xhtml+xml,application/xml;q=0.9,*/*;q=0.8], keep-alive=[300]}
Payload:
But in run time I can see jsessionid present in request.
ID: 2
Address: /abc/REST/services/xyz
Encoding: UTF-8
Content-Type:
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
accept-language=[en-us,en;q=0.5], host=[localhost:8084], accept-
charset=[ISO-8859-1,utf-8;q=0.7,*;q=0.7], user-agent=[Mozilla/5.0
(Windows; U; Windows NT 5.1; en-US; rv:1.9.1.10) Gecko/20100504
Firefox/3.5.10], Content-Type=[null],
cookie=[JSESSIONID=DDB46103078A31847CA615E593B84869;
chkcookie=1279110426293], Accept=[text/html,application/xhtml
+xml,application/xml;q=0.9,*/*;q=0.8], keep-alive=[300]}
Payload:
Is there anything I am missing or doing something wrong? Suggestions
are welcome :)
Thank you
Sudheer
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.