注销后还有用户正在执行操作,我必须写什么代码来防止注销的用户? [英] After logout also user is performing operations ,what code i have to write to prevent that loggedout user?

查看:126
本文介绍了注销后还有用户正在执行操作,我必须写什么代码来防止注销的用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有!在注销后,用户也在我创建的网站中执行操作,这是在gwt和java中开发的,我必须编写哪些代码来防止该用户?我的意思是如何编写代码来防止'注销'后的用户操作。无论何时用户要在注销后点击页面上的任何链接,只要他看到消息您没有登录查看,这是我的要求。可以有人说?....谢谢bala ... gwtdesigner / tutorials / loginmanagerrel =nofollow>这个链接
这解释了你如何使用GWT编写登录应用程序



Code..If你有MyProfilePlace,MyProfileView然后MyProfileActivity将看起来像

 私人ClientFactory clientFactory; 

public MyProfileActivity(MyProfilePlace place,ClientFactory clientFactory){

this.clientFactory = clientFactory;


$ b @Override
public void start(AcceptsOneWidget containerWidget,EventBus eventBus){

//伪代码
(会话无效{
Window.alert(对不起,您没有登录);
goTo(新的LoginPlace(登录));
}

view = clientFactory.getMyProfileView();
view.setPresenter(this);
containerWidget.setWidget(view.asWidget());
System.out.println(去你的个人资料);
}


All! After logout also user is performing operations in my created website which was developed in gwt and java ,what code i have to write to prevent that user?. I mean how to write code to prevent the user operations after 'logout'. whenever the user is going to click on any link on the page after logout,just he should see the message "You are not logged in to view",this is my requirement .can anybody say?....thanks bala...

解决方案

Have a look at this link This explains how do you write login app using GWT

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");
}

这篇关于注销后还有用户正在执行操作,我必须写什么代码来防止注销的用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆