How do I know a user has been logged out from another screen

If one user is already logged in to the web application and another user with the same user name and password trying to log in to the same web application, i need to logout the first screen's user session. In other word, I want to disable first screen access right since it has been logged out.
I have a user log class to record users login activities. A new user log object will be created for every login.
How should I do that?

Try to write an implementation of HttpSessionListener and HttpSessionAttributeListener something like the one down below and configure it accordingly.Believe tht should very well cater your requirment.
public SessionAttributeListener implements HttpSessionAttributeListener,HttpSessionListner{
   List<HttpSession> sessionsList;
    public SessionAttributeListener(){
         this.sessionsList = new ArrayList<HttpSession>();   
    public void sessionCreated(HttpSessionEvent se){
    public void sessionDestroyed(HttpSessionEvent se) {
            this.sessionList.remove(se.getSession());
    public void attributeAdded(HttpSessionBindingEvent se){
                if(se.getName().equals("userInfo"))
                     this.appAction(se);
    public void attributeRemoved(HttpSessionBindingEvent se){
              if(se.getName().equals("userInfo"))
                        this.sessionsList.remove(se.getSession());  
    public void attributeReplaced(HttpSessionBindingEvent se) {
    private void appAction(HttpSessionBindingEvent se){
                UserBean ub = (UserBean)se.getValue();
                 for(HttpSession session:this.sessionsList) {
                         UserBean ub1 = (UserBean)session.getAttribute("userInfo"); 
                         if(ub1.getUserName().equals(ub.getUserName())){
                                try{
                                   session.removeAttribute("userInfo");
                                   session.invalidate();
                               }catch(Exception exp){}
                this.sessionsList.add(se.getSession());
}Hope this might give you a brief idea of how to go about. :)
REGARDS,
RaHuL

Similar Messages

  • How do I know what Opatch has been installed on OBIEE 11.1.1.6.2?

    Hi,
    I started working with new client and someone does obiee upgrade to 11.1.1.6.2. now users got some issue and we identified that issue can be resolved if we apply a patch and to apply that patch it is saying please make sure you have installed pre requisite patch with some number. how do I know what Opatch has been installed on OBIEE 11.1.1.6.2?
    any command or file available?
    Edited by: JV123 on Feb 14, 2013 2:48 PM

    Check this
    http://www.cool-bi.com/CMDline/DeterminingCurrentPatchLevels.php
    If helps mark

  • How do I know which block has been changed in Master/Detail

    Hi,
    I have master detail blocks. How do I know which block has been changed?
    I used :SYSTEM.FORM_STATUS. It only gave me "Changed" or "Query". but didn't tell me which block has been changed in MASTER or DETAIL.

    I believe if :system.form_status != 'QUERY' you'll need to loop through through the blocks checking :system.block_status to see who changed. Of course you'd have to go_block() before checking the status.

  • The account "sadmin" has been deleted out from under us!

    We have a new Intel Xserve we recently set up with 10.6 Server. Initially we ran OD, DNS, and DHCP only on the machine while our file shares continued to run on our older 10.4 Servers. When I moved our Xserve RAID (Formatted off of the old server and onto the Xserve we started experiencing issues where after approximately 24 hours we would have authentication issues connecting via SMB or AFP. Also, when I tried to connect via ARD or SSH I was unable to authenticate. Sometimes I could SSH in as root but others I would have to go to the console directly. A reboot clears the issue but about 24 hours later it comes back.
    Looking at the console I see:
    3/5/10 8:08:58 AM com.apple.launchd.peruser.501[187] (com.apple.PreferenceSyncAgent[58171]) The account "sadmin" has been deleted out from under us!
    3/5/10 8:08:58 AM com.apple.launchd.peruser.501[187] (com.apple.PreferenceSyncAgent[58171]) In a future build of the OS, this error will be fatal.
    3/5/10 8:09:23 AM com.apple.launchd.peruser.501[187] (com.apple.SubmitDiagInfo[58190]) The account "sadmin" has been deleted out from under us!
    3/5/10 8:09:23 AM com.apple.launchd.peruser.501[187] (com.apple.SubmitDiagInfo[58190]) In a future build of the OS, this error will be fatal.
    3/5/10 8:09:29 AM com.apple.launchd.peruser.501[187] ([0x0-0x61061].com.apple.iCal.helper[58201]) The account "sadmin" has been deleted out from under us!
    3/5/10 8:09:29 AM com.apple.launchd.peruser.501[187] ([0x0-0x61061].com.apple.iCal.helper[58201]) In a future build of the OS, this error will be fatal.
    (note: iCal service is not running)
    Any ideas on this? Daily reboots are annoying.

    I have the same problem (deleted email account). I think I mistakenly set up an account when I was buying an Apple product online, not realizing that it would be the same ID as my iTunes.
    What is the way to actually contact Apple?
    I have been clicking around in circles for hours! Will I have to pay them to resolve this? I don't have any products still have applecare . . .

  • How to delete the temporary files when we log out from ESS

    Hello expert,
    In my company we are running ESS using ITS server, do you know how to delete the temporary files when we log out from ESS?
    Thanks.

    The temporary files used by ESS. For example paystub pdf file.

  • How do I know what item has been selected in a select list?

    I built a select list where the user selects one item from the list and then searches using the searchfield. I need to know what item has been selected in the select list so that I can do branching and branch the user to a particular page. Can someone tell me how I can accomplish this?
    So if I want to search for Tea in the drinks category I would need to click on Drink in the select list and then type "Tea" and select search. After that I get redirected to a table called "Drinks" and there the search results will be displayed. please help!

    I tried to mach expressions... I made a simple list(with redirection):
    STATIC:Yes;Y,No;N and it displays fine. I then try to do branching where exp1=exp2 Where I tried to have the label "X" for E1 and "Y" for E2 and nothing happened. I tried to use the name of the list Xlist and it failed too. I tried Request=exp1 and didnt work either. I set the source for the list as static. I am not sure what I am doing wrong. When i tried !=exp nothing happened either... perhaps the values I am using are wrong? Pleas help me out.

  • How to unlock macbook pro that has been remote locked from the icloud

    how do you unlock the macbook pro that has been remotly locked from the icloud because i forgot my password

    This question should NOT be answered. Using Find My Mac to lock one's computer is a personal security measure for those whose Macs have been lost or stolen and may be in the hands of criminals. Publicly posting instructions for defeating that measure would be tantamount to abetting theft.
    If you have foolishly locked your own computer and need to unlock it, take it to an Apple Store. Be prepared to prove you are its rightful owner.

  • HT1212 how will i know when ipad has been restored?

    I am trying to restore my ipad.  Itunes has finished downloading the update.  how will i know when the ipad has been restored?

    It has given me an error 3194 - this device is not eligible for the requested build.  What now?

  • JRadioButtons - how do i know which one has been clicked?!

    hey all,
    im working on a simple gui to implement a ticket office system. im a bit of a newbie to using GUIs and im fed up of trawling through the api's in search of answers and im on the home run... so here's my q...
    i have a gui class for doing a search for tickets. i have a controller in a seperate actionListener class for this gui. i have three radio buttons for searching for three different things and then there's a search jbutton to start the search.
    how do i know what radio button the user has selected when they click search? i need to be able to know this from the controller, not in the gui itself.
    thanks a mil!

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class TicketOffice_Demo extends JFrame {
        public TicketOffice_Demo() {
            initComponents();
        private void initComponents() {
            ticketsGroup = new ButtonGroup();
            toolbar = new JToolBar();
            startSearch = new JButton();
            typeA = new JRadioButton();
            typeB = new JRadioButton();
            typeC = new JRadioButton();
            scrollpane = new JScrollPane();
            textarea = new JTextArea();
            setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
            setTitle("Ticket Office Demo");
            toolbar.setFloatable(false);
            startSearch.setText("Start Search");
            startSearch.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent evt) {
                    startSearchActionPerformed(evt);
            toolbar.add(startSearch);
            ticketsGroup.add(typeA);
            typeA.setSelected(true);
            typeA.setText("\"A\" Tickets");
            typeA.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeA);
            ticketsGroup.add(typeB);
            typeB.setText("\"B\" Tickets");
            typeB.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeB);
            ticketsGroup.add(typeC);
            typeC.setText("\"C\" Tickets");
            typeC.addItemListener(new ItemListener() {
                public void itemStateChanged(ItemEvent evt) {
                    typeAItemStateChanged(evt);
            toolbar.add(typeC);
            getContentPane().add(toolbar, BorderLayout.NORTH);
            textarea.setBackground(new Color(255, 255, 204));
            textarea.setEditable(false);
            scrollpane.setViewportView(textarea);
            getContentPane().add(scrollpane, BorderLayout.CENTER);
            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
            setBounds((screenSize.width-400)/2, (screenSize.height-300)/2, 400, 300);
        private void startSearchActionPerformed(ActionEvent evt) {
            Controller cont = new Controller(ticketType);
            textarea.append("Controller searches for ticket type '"+cont.getTicketType()+"'\n");
        private void typeAItemStateChanged(ItemEvent evt) {
            if(typeA.isSelected()){
                ticketType = "A";
            }else if(typeB.isSelected()){
                ticketType = "B";
            }else if(typeC.isSelected()){
                ticketType = "C";
        public static void main(String args[]) {
            new TicketOffice_Demo().setVisible(true);
        private JButton startSearch;
        private JRadioButton typeA;
        private JRadioButton typeB;
        private JRadioButton typeC;
        private JScrollPane scrollpane;
        private JTextArea textarea;
        private JToolBar toolbar;
        private ButtonGroup ticketsGroup;
        private String ticketType ="A";
    class Controller {
        Controller(String ticketType){
            this.ticketType = ticketType;
        public String getTicketType(){
            return ticketType;
        private String ticketType;
    }

  • How do i know if row has been updated?

    Hi
    Please can someone guide me on how I can determine if my update has been successful. I am currently using the method below but my data is being put into the table but the method rowUpdated() returns false when it should return true.
    rs.moveToInsertRow();
    rs.updateString("SL_Name", "Antek")
    rs.insertRow();
    System.out.println("Row updated " + rs.rowUpdated());
    Thanxs
    Antek

    I am using a primary key which is set by ms-sql server and it has the properties not-null auto incrementing. I was using the manual insert function before but then I realised the moveToInsertRow() method so I changed because of the added benefits to my program I can get. Before I was using the following code to see if a row was inserted see below. (I want something similar for the new way I insert data into table please)
    ======
    what i use to use before
    ======
    int numRows= myStatement.executeUpdate(sql);          
    System.out.println(numRows + " rows updated");
    if (numRows > 0)
    returnString = "success";
    Antek

  • How do I know my iPhone has been wiped?

    Hi, my iPhone got stolen last night so I went home immediately and logged into me.com/icloud to wipe it, but it's saying that the request has been sent but will only be wiped once connected to the Internet.
    Whoever has taken it has turned it off, but if they turn it on again they will be able to use it provided they don't connect to the Internet, right? I had disabled 3G/data roaming so it won't be instantly connected to the Internet once they turn it on. Please help!

    They will very likely just restore the iphone and use it as their own.
    Your data should be safe.

  • How do I know which workflow has been activated for my SHC in SRM

    Hi Experts ,
    Can anyone tell me where to find which workflow has been activated to my Shopping cart in the SRM. so that it creates a PO in the backend
    To create a PO in the back end it should have a WF actiavted.
    do we can have only always one WF activated or can we have multiple WFs depending on the conditions for one scenario
    Please suggest me
    Regards
    Sairam.

    Cross-Application Basic Settings u2192 SAP Business Workflow u2192 Perform Task-Specific Cusomizing
    SAP u2192 SRM u2192 SRM-EBP u2192 SRM-EBP-WFL
           -   WS10000060 (Automatic approval)
             -   WS10000129 (One-step approval)
             -   WS10000031 (Two-step approval)
             -   WS10000276 (Approval single-level over limit)
             -   WS14000044 (Completion by purchaser)
             -   WS14000109 (Approval n-step over value limit)
             -   WS14500015 (Item approval)
             -   WS14000045 (Delete shopping cart after application error)
             -   WS10000202 (Transfer purchase requisition)
             -   WS10000215 (Resubmission of shopping cart by administrator)
    You need to check Event linkage is either Activated or Deactivated aor these above work flow . I fit is activated it shows green light.
    Muthu
    Edited by: muthuraman on Jul 29, 2008 2:38 PM

  • If my iPad is lost, how do I know when it has been removed from my Apple ID account?

    I lost my son's iPad this afternoon. By the time I realized I couldn't find it and pulled out my phone to use the Find Phone My iPhone app, it may have been too late to set it up as lost. The iPad is still displaying in the app, but simply as offline. Of course, the iPad could be laying on the street somewhere, God only knows. However, if someone had reset the iPad and logged it into their own account, would it still display on my "Find My iPhone" account even if it were offline? Or, since they can reset it without being online, will it wait to refresh until they get it online? I am literally sick to my stomach, I just bought this 64 gig brand new mini two months ago for my autistic son, and he uses it daily. I cannot fathom the idea that it is not in the house, but if it were in the house, it would be connected to our Wifi automatically, and it would not be dead because I just charged it for him for our short trip today. How can I see if the seriel number is even still on my account? When I go into my account, it shows a white mini ipad, ours is black, and it does not show the same seriel number. HOWEVER, it does show that I called about the Mini on the 29th of October, so even though it is displaying as white with a randomly different seriel number, I did call about an issue on that device. Why would iTunes have a different mini seriel number set up under our account? If you cannot tell, I am freaking out. We're out $500 and I feel like there just has to be a way to get our iPad back. (Just for all of you KARMA beleivers out there: About a year and a few months ago, I was at the pool with my son and found a Kindle Fire. I immediately went through to find the owners information and contacted her to return it! There has to be good Karma for me in this situation!! ;-)  )   Please, help me determine if the iPad is still connected to my account! Anything! Thanks!

    I think you may need to book an appointment with a genius! They will fix it or replace it for you, for free!!! You can book an appointment at your local apple store at http://www.apple.com/retail
    Hope this helps
    Conchuir

  • Dynamic h:commandLinks : how do I know which one has been clicked?

    Imagine I have something like:
    <h:dataTable etc etc>
    <h:column>
    <h:outputText etc etc />
    </h:column>
    <h:column>
    <h:commandLink action="#{BeanName.removeEntry}" />
    </h:column>
    </h:dataTable>
    <h:inputText etc etc><h:commandLink action="#{BeanName.addEntry}" />
    so that when I add Entries, they get seen on the dataTable above..
    THe addEntry code is easy to do, it's only a ArrayList.add() method call but what about the removeEntry? I don't know how to figure out which 'remove' commandLink was clicked.

    If you have a datamodel in yo
    ur datatable, then you can do something like this:
    getModel().getRowData()
    This returns the selected row.
    From here it's with you.....

  • How do I know if spyware has been installed?

    Weird stuff is happening with my device.  No apps will be running and the audio recorder bar will be red and recording via autorap.  Background was changed while I showered the other morning.  Nobody in my home, was done remotely.  Battery drains quickly and if the iPad completely dies, you can only charge it on a dock, sync n charge cord will not work.  Need this crap removed.  HELP!!!!

    Hi Starlish,
    The only thing I can suggest doing is holding the power and the home button untill the iPad goes off and then trying to plug in to restore.
    Sorry if this is no good, but I really hope it helps.
    If that does not work than try this:
    Also, In General > Reset you have an option to Erase all Content and Settings.
    Message was edited by: Jpwpalfrey

Maybe you are looking for

  • Cluster does not populate in sub-vi unless front panel is opened

    I have a sub-vi that saves my data to a database and the cluster containing the data will not populate unless I open the front panel when it executes.  What could possibly cause this?

  • Object instance 1200 does not exist (while executing task SWUS)

    hello all, i have created a workflow class and two methods (constructor, display) and 1 attribute PLANT (instance,public) in it. i am using this class and display method in task t code PFTC. While executing this task from SWUS , i am getting this err

  • Help me delete my emails, please

    Hello everybody - hope someone can help me. Up until recently I had two ways to check my emails: my computer at home Outlook Express, and when away, I went into BT Yahoo on other computers. Now my daughter has bought me an iPad which is great BUT the

  • I have a problem with Pages shutting down my documents.

      I have a problem with Pages shutting down my documents. I have several several documents on my homepage,but once I select one it shuts down and goes to the ipad homepage.Other documents open with no problem. Can someone tell me what's happening ant

  • Problem with arguments!!!!

    I have this program: public class StringArraysMeta     public static void main(String[] args)         String[] myString=new String[10]         for (int i=0; i<args.length; i++)             System.out.println(myString); }and i want to feed into string