2009-06-29 27 views
1

在我的servlet中,我有這條線如何在gwt客戶端中設置Cookie?

CookieManager.getRequestCookieValue(request,「app-openid-identifier」); CookieManager.getRequestCookieValue(請求,「app-openid-uniqueid」);

在我的gwt客戶端組合文件中,如何爲「app-openid-identifier」設置cookie並「調用」servlet?

回答

6

在GWT應用程序,你可以使用:

com.google.gwt.user.client.Cookies.setCookie("app-openid-identifier","some value"); 

對於GET請求使用:

com.google.gwt.http.client.RequestBuilder 

或者如果可能的話儘量使用RPC調用來代替。