更新时间:2023-12-02 13:03:22
查看 这个链接这解释了如何使用 GWT 编写登录应用程序
Have a look at this link This explains how do you write login app using GWT
或者在代码中..如果你有 MyProfilePlace,MyProfileView 那么 MyProfileActivity 看起来像
Or as in Code..If you have MyProfilePlace,MyProfileView then MyProfileActivity will look like
private ClientFactory clientFactory;
public MyProfileActivity(MyProfilePlace place, ClientFactory clientFactory) {
this.clientFactory = clientFactory;
}
@Override
public void start(AcceptsOneWidget containerWidget, EventBus eventBus) {
//pseudo code
if (session invalidated {
Window.alert("Sorry you are not logged in");
goTo(new LoginPlace("login"));
}
view = clientFactory.getMyProfileView();
view.setPresenter(this);
containerWidget.setWidget(view.asWidget());
System.out.println("Going to your profile");
}