Guru, I think he's missed the fundamental point about the sever not being able to determine if a user closes the browser.
Maybe it's worth re-iterating to him about the sever not being able to determine if a user closes the browser. Or telling him about the sever not being able to determine if a user closes the browser. Possibly letting him know about the sever not being able to determine if a user closes the browser. And then say that the best you can do is monitor the session for expiry. Just a though ;). Al. -----Original Message----- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 12:34 To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hello, do not try to hijack other thread. Reply to your own thread. No as I said it will be called when your session expires ..... What is your session timeout value ? This should be something like <session-config> <session-timeout>30</session-timeout> <!-- 30 minutes --> </session-config> With this configuration in web.xml your session will expire in 30 mins And when this is done your method will execute ... I assume you have registered your listener in web.xml I hope this helps Guru -----Original Message----- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 11:34 To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. This is the snippet I am writing in my login action if(servlet.getServletContext().getAttribute("userList")!=null){ System.out.println(" IN SIDE IF OF CONTEXT "); Hashtable findUser = new Hashtable(); findUser = (Hashtable) servlet.getServletContext().getAttribute("userList"); findUser.contains(username); expDTO = new ExceptionDisplayDTO(DFSConstants.FORWARD_FAILURE,ExpContextConstants.LOG IN_FAILED); expDisplayDetails.set(expDTO); throw new LoginFailedException("LoginFailedException"); }else{ System.out.println(" IN SIDE ELSE OF CONTEXT "); Hashtable userList = new Hashtable(); userList.put("username",username); servlet.getServletContext().setAttribute("userList",userList); } But the thing is if the user close the IE instead of log out I am unable to remove the user from the hash table How can I overcome this? Regards, Sreenivasula Reddy A -----Original Message----- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:48 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi guru volume of hits is less and my server is running on single machine only so give me some sample snippet for this kind of development -----Original Message----- From: Raghupathy, Gurumoorthy [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 06, 2007 1:19 PM To: Struts Users Mailing List Subject: RE: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. My answer is "It depends"..... If the volume (number of hits) of your website is low and your server is on a single node then you can create a hashtable of users (user name as key) as an CONTEXT attribute and each time someone logs in you can check the user against the key in the hashtable ... if the keay already exists tell them to Get lost and once the user is logged off you can remove them from the hash.. If your application is running as part of a farm then store the status in DB / persistence medium. However there will be a performance hit Have a look at http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ServletConte xt.html One pattern which can be of helps is "observer pattern" which will observe user logging in and logging out.... when used as a filter .... http://java.sun.com/products/servlet/Filters.html some of the questions you have been asking on the forum has nothing to do with struts ... it is all about servlet specification .... Read them at http://jcp.org/aboutJava/communityprocess/final/jsr154/index.html My suggestion will again be RTFM Regards Guru -----Original Message----- From: Srinivasula Reddy A , Bangalore [mailto:[EMAIL PROTECTED] Sent: 06 June 2007 07:51 To: Struts Users Mailing List Subject: How to Protect the user to login in Multiple system (Multiple browser) when the session is active. Hi Team, How to protect the user to login in multiple browsers when the session is action. For example in gmail if we login in one browser and we are surfing, then if we open another IE and type gmail it will redirect to the page where we are surfing in the previous IE. I need this kind of feature for my login system. How to implement this in struts Give me some sample snippet or rough idea Regards, Sreenivasula Reddy A DISCLAIMER: ------------------------------------------------------------------------ ----------------------------------------------- The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect. ------------------------------------------------------------------------ ----------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]