GWT RPC 响应标头
有没有办法读取 GWT 客户端在 RPC 响应上收到的标头信息?
Response header
Server Apache-Coyote/1.1
Set-Cookie JSESSIONID=3379B1E57BEB2FE227EDC1F57BF550ED; Path=/GWT
Content-Encoding gzip
Content-Disposition attachment
Content-Type application/json;charset=utf-8
Content-Length 209
Date Fri, 05 Nov 2010 13:07:31 GMT
我特别感兴趣的是确定客户端何时收到其标头上的 Set-Cookie 属性。
在 GWT 上有什么办法可以做到这一点吗?
我发现在
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter<T>
参数 Response 上存在的方法
public void onResponseReceived(Request request, Response response) { ... }
似乎有我需要的信息。这是,是否有某种方法可以在不“破坏”GWT 编译器代码的情况下实现这一点?
谢谢
朱达克
Is there any way to read the header information received by GWT client, on the RPC response?
Response header
Server Apache-Coyote/1.1
Set-Cookie JSESSIONID=3379B1E57BEB2FE227EDC1F57BF550ED; Path=/GWT
Content-Encoding gzip
Content-Disposition attachment
Content-Type application/json;charset=utf-8
Content-Length 209
Date Fri, 05 Nov 2010 13:07:31 GMT
I'm particularly interest in identifying when client receives the Set-Cookie attribute on its header.
Is there any way to do that on GWT?
I found that on
com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter<T>
exist the method
public void onResponseReceived(Request request, Response response) { ... }
On the parameter Response seems to have the information I need. The this is, exist some way to get that without "racking" the GWT compiler code?
thanks
JuDaC
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以尝试重写
RpcRequestBuilder.doSetCallback
方法并强制您的服务使用它:受到 http://stuffthathappens.com/blog/2009/12/22/custom-http-headers-with-gwt-rpc/
You may try to override the
RpcRequestBuilder.doSetCallback
method and force your service to use it:Inspired by http://stuffthathappens.com/blog/2009/12/22/custom-http-headers-with-gwt-rpc/
如果您声明异步服务方法返回 RequestBuilder 您应该能够设置 RequestCallback,当 响应已收到。我自己没有尝试过,但它看起来像你所需要的。
If you declare your async service method to return a RequestBuilder you should be able to set a RequestCallback that will be notified when the Response is received. I haven't tried this myself, but it looks like what you need.