简体   繁体   English

如何为SWT浏览器和Jetty HttpClient设置相同的CookieStore

[英]How set the same CookieStore for SWT browser and Jetty HttpClient

Since a java.net.CookieStore manages cookies in org.eclipse.jetty.client.HttpClient , I want to share the cookies with the SWT Browser widget. 由于java.net.CookieStoreorg.eclipse.jetty.client.HttpClient管理cookie,因此我想与SWT Browser小部件共享cookie。

HttpClient and Browser are both Eclipse technologies. HttpClient和Browser都是Eclipse技术。 Is there a way to have the same cookie store? 有没有办法拥有相同的Cookie存储区?

No, you cannot share the Cookie stores of HttpClient and SWT Browser. 不,您不能共享HttpClient和SWT Browser的Cookie存储。 The Browser control uses the cookie store of the underlying native Browser, eg Mozilla, WebKit of IE. 浏览器控件使用基础本机浏览器的cookie存储,例如Mozilla,IE的WebKit。

You may want to try Browser::setCookie() and getCookie() to store and retrieve specific SWT cookies. 您可能要尝试使用Browser::setCookie()getCookie()来存储和检索特定的SWT cookie。 The changes apply to all Browser control instances within an SWT application. 所做的更改将应用​​于SWT应用程序中的所有Browser控件实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM