Đang chuẩn bị liên kết để tải về tài liệu:
Apress bắt đầu ứng dụng với java google - p 16

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

CHAPTER 6 ■ AUTHENTICATING USERS LoginInfo Class This class is a simple POJO returned by the User service when a user has successfully logged in using the Google Accounts service. The LoginInfo class is implemented in Listing 6-2. Listing 6-2. The code for LoginInfo.class package com.appirio.timeentry.client; import java.io.Serializable; public class LoginInfo implements Serializable { private private private private private boolean loggedIn = false; String loginUrl; String logoutUrl; String emailAddress; String nickname; public boolean isLoggedIn() { return loggedIn; } public void setLoggedIn(boolean loggedIn) { this.loggedIn = loggedIn; } public String getLoginUrl() { return loginUrl; } public void setLoginUrl(String loginUrl) { this.loginUrl = loginUrl; }. | CHAPTER 6 AUTHENTICATING USERS LoginInfo Class This class is a simple POJO returned by the User service when a user has successfully logged in using the Google Accounts service. The LoginInfo class is implemented in Listing 6-2. Listing 6-2. The code for LoginInfo.class package com.appirio.timeentry.client import java.io.Serializable public class LoginInfo implements Serializable private boolean loggedIn false private String loginUrl private String logoutUrl private String emailAddress private String nickname public boolean isLoggedIn return loggedIn public void setLoggedIn boolean loggedIn this.loggedIn loggedIn public String getLoginUrl return loginUrl public void setLoginUrl String loginUrl this.loginUrl login Url public String getLogoutUrl return logoutUrl public void setLogoutUrl String logoutUrl this.logoutUrl logou tUrl 128 CHAPTER 6 AUTHENTICATING USERS public String getEmailAddress return emailAddress public void setEmailAddress String emailAddress this.emailAddress emailAddress public String getNickname return nickname public void setNickname String nickname this.nickname nickn ame LoginService and LoginServiceAsync Interfaces Now you need to create two interfaces defining your login service and its methods. In Listing 6-3 notice the login path annotation in the LoginService class. You ll configure this path in the deployment descriptor to map the configuration to this service. Listing 6-3. The code for LoginService.class package com.appirio.timeentry.client import com.google.gwt.user.client.rpc.RemoteService import com.google.gwt.user.client.rpc.RemoteServiceRelativePath @RemoteServiceRelativePath login public interface LoginService extends RemoteService public Logininfo login String requestUri Next you need to add an AsyncCallback parameter to your service method. Your interface in Listing 6-4 must be located in the same package as the service interface and must also have the same name but appended with Async. Each method in this interface must have the

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.