TAILIEUCHUNG - Apress bắt đầu ứng dụng với java google - p 16

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 package ; import ; 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) { = loggedIn; } public String getLoginUrl() { return loginUrl; } public void setLoginUrl(String 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 package import 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 loggedIn public String getLoginUrl return loginUrl public void setLoginUrl String loginUrl login Url public String getLogoutUrl return logoutUrl public void setLogoutUrl String logoutUrl logou tUrl 128 CHAPTER 6 AUTHENTICATING USERS public String getEmailAddress return emailAddress public void setEmailAddress String emailAddress emailAddress public String getNickname return nickname public void setNickname String 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 package import import @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

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.