RE: Detecting browser close

2004-06-22 Thread Guillermo Meyer
We are detecting when the user closes the browser window with this
javascript (only in IE with JS enabled):

script
function logoff() {
if (document.all) {
// IExplorer
if (window.screenTop  9000) {
// window closed
top.location=%=request.getContextPath()%/logoff.do;
//get the logoff action
} else {
// window refreshed
}  
}
}
/script
body onunload=logoff();

/body

Hope this help.
Cheers.
Guillermo.

-Original Message-
From: Frank Zammetti [mailto:[EMAIL PROTECTED] 
Sent: Lunes, 21 de Junio de 2004 01:03 p.m.
To: [EMAIL PROTECTED]
Subject: RE: Detecting browser close


It was my understanding that only signed scripts could open popups 
off-screen, or of too small a size (I think 100px in either direction).

I use the approach you outline as well, although it's not critical that
the 
user logs out of my app anyway but they do feel good about having an 
explicit logout button.  I however pop up a small now logging out
message 
for them in the new window, partly because I think that's perhaps nicer
to 
show that what they asked to happen actually did, but also because an 
off-screen popup wasn't allowed.

Just curious how you got the off-screen popup to work without a signed 
script (assuming you didn't have one?).


From: Joe Hertz [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Detecting browser close
Date: Mon, 21 Jun 2004 11:56:56 -0400

This is fine if you want to provide a popup window to the user. This 
still isn't an authoritative way of determining if the user has logged

out.

Your app should never depend on the client's PC having electricity.

  -Original Message-
  From: Simone - Dev [mailto:[EMAIL PROTECTED]
  Sent: Sunday, June 20, 2004 6:48 AM
  To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
  Subject: R: Detecting browser close
 
 
  What I'm proposing to you it's a solution that works only on JS 
  enabled browsers, but since this is almost the 99,99% of the browser

  on the market shouldn't be a problem :-)
 
  On the onClose event of the window object (javascript object) opens 
  a new window of 10px that is displayed off the screen (8000px left):

  this windows will contain a page that close all session specific 
  resources as soon as the user exit, without having to wait the 
  session timeout to expire
 
  I used it many times, also to provide a u forgot to save what you 
  did, are you sure you want to exit the page? alert (but this need a

  onBeforeClose event that is available only on IE).
 
  Simone
 
  -
  Simone Chiaretta
  www.piyosailing.com/S
  Any sufficiently advanced technology is indistinguishable from magic

  Life is short, play hard
 
 
   -Messaggio originale-
   Da: ksitron [mailto:[EMAIL PROTECTED]
   Inviato: sabato 19 giugno 2004 23.32
   A: Struts Users Mailing List
   Oggetto: Detecting browser close
  
  
  
   Is there a way to detect when the user closes the browser.
  What I want
   to do is do clean-up and destroy the session.
  
  
   Thanks in advance.
  
   --
  
  
  
  
  
  
  
  -
   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]


_
MSN 9 Dial-up Internet Access fights spam and pop-ups - now 3 months
FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

NOTA DE CONFIDENCIALIDAD
Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las 
personas direccionadas en el mail y puede contener informacion (i)de propiedad 
exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier 
opinion en el contenido, es exclusiva de su autor y no representa necesariamente la 
opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion 
esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna 
por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha 
recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo 
inmediatamente junto con todas las copias del mismo, notificando al remitente. No 
debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni

RE: Detecting browser close

2004-06-21 Thread Joe Hertz
This is fine if you want to provide a popup window to the user. This
still isn't an authoritative way of determining if the user has logged
out.

Your app should never depend on the client's PC having electricity.

 -Original Message-
 From: Simone - Dev [mailto:[EMAIL PROTECTED] 
 Sent: Sunday, June 20, 2004 6:48 AM
 To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
 Subject: R: Detecting browser close
 
 
 What I'm proposing to you it's a solution that works only on 
 JS enabled browsers, but since this is almost the 99,99% of 
 the browser on the market shouldn't be a problem :-)
 
 On the onClose event of the window object (javascript object) 
 opens a new window of 10px that is displayed off the screen 
 (8000px left): this windows will contain a page that close 
 all session specific resources as soon as the user exit, 
 without having to wait the session timeout to expire
 
 I used it many times, also to provide a u forgot to save 
 what you did, are you sure you want to exit the page? alert 
 (but this need a onBeforeClose event that is available only on IE).
 
 Simone
 
 -
 Simone Chiaretta
 www.piyosailing.com/S
 Any sufficiently advanced technology is indistinguishable 
 from magic Life is short, play hard
 
 
  -Messaggio originale-
  Da: ksitron [mailto:[EMAIL PROTECTED]
  Inviato: sabato 19 giugno 2004 23.32
  A: Struts Users Mailing List
  Oggetto: Detecting browser close
  
  
  
  Is there a way to detect when the user closes the browser. 
 What I want 
  to do is do clean-up and destroy the session.
  
  
  Thanks in advance.
  
  --
  
  
  
  
  
  
 -
  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]



RE: Detecting browser close

2004-06-21 Thread Frank Zammetti
It was my understanding that only signed scripts could open popups 
off-screen, or of too small a size (I think 100px in either direction).

I use the approach you outline as well, although it's not critical that the 
user logs out of my app anyway but they do feel good about having an 
explicit logout button.  I however pop up a small now logging out message 
for them in the new window, partly because I think that's perhaps nicer to 
show that what they asked to happen actually did, but also because an 
off-screen popup wasn't allowed.

Just curious how you got the off-screen popup to work without a signed 
script (assuming you didn't have one?).


From: Joe Hertz [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Subject: RE: Detecting browser close
Date: Mon, 21 Jun 2004 11:56:56 -0400
This is fine if you want to provide a popup window to the user. This
still isn't an authoritative way of determining if the user has logged
out.
Your app should never depend on the client's PC having electricity.
 -Original Message-
 From: Simone - Dev [mailto:[EMAIL PROTECTED]
 Sent: Sunday, June 20, 2004 6:48 AM
 To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
 Subject: R: Detecting browser close


 What I'm proposing to you it's a solution that works only on
 JS enabled browsers, but since this is almost the 99,99% of
 the browser on the market shouldn't be a problem :-)

 On the onClose event of the window object (javascript object)
 opens a new window of 10px that is displayed off the screen
 (8000px left): this windows will contain a page that close
 all session specific resources as soon as the user exit,
 without having to wait the session timeout to expire

 I used it many times, also to provide a u forgot to save
 what you did, are you sure you want to exit the page? alert
 (but this need a onBeforeClose event that is available only on IE).

 Simone

 -
 Simone Chiaretta
 www.piyosailing.com/S
 Any sufficiently advanced technology is indistinguishable
 from magic Life is short, play hard


  -Messaggio originale-
  Da: ksitron [mailto:[EMAIL PROTECTED]
  Inviato: sabato 19 giugno 2004 23.32
  A: Struts Users Mailing List
  Oggetto: Detecting browser close
 
 
 
  Is there a way to detect when the user closes the browser.
 What I want
  to do is do clean-up and destroy the session.
 
 
  Thanks in advance.
 
  --
 
 
 
 
 
 
 -
  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]
_
MSN 9 Dial-up Internet Access fights spam and pop-ups – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Detecting browser close(ksitron [mailto:ksitron@elp.rr.com])

2004-06-21 Thread smuthu . subramaniam





Hi
If u r working with Internet Explorer then try this code

script
window.onunload=onClose;

function onClose() {
var retVal;
if(window.screenTop1) {
 alert(Closing the window);
}
}



/script

by clicking the close button on the top right corner, rightclicking and
selecting the close from taskbar,pressing alt+f4 this function onClose will
be called.
then from there u can submit the page and then u can invalidate the session
in the Action class

i havn't checked this on other browser's

hope this will help u
ForwardSourceID:NT0

DISCLAIMER: The information contained in this message is intended only and solely for 
the addressed individual or entity indicated in this message and for the exclusive use 
of the said addressed individual or entity indicated in this message (or responsible 
for delivery
of the message to such person) and may contain legally privileged and confidential 
information belonging to Tata Consultancy Services. It must not be printed, read, 
copied, disclosed, forwarded, distributed or used (in whatsoever manner) by any person 
other than the addressee. 
Unauthorized use, disclosure or copying is strictly prohibited and may constitute 
unlawful act and can possibly attract legal action, civil and/or criminal. The 
contents of this message need not necessarily reflect or endorse the views of Tata 
Consultancy Services on any subject matter.
Any action taken or omitted to be taken based on this message is entirely at your risk 
and neither the originator of this message nor Tata Consultancy Services takes any 
responsibility or liability towards the same. Opinions, conclusions and any other 
information contained in this message 
that do not relate to the official business of Tata Consultancy Services shall be 
understood as neither given nor endorsed by Tata Consultancy Services or any affiliate 
of Tata Consultancy Services. If you have received this message in error, you should 
destroy this message and may please notify the sender by e-mail. Thank you.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Detecting browser close

2004-06-20 Thread Pedro Salgado
On 04/06/20 3:49, mike [EMAIL PROTECTED] wrote:

 There are ways, if you are so adamant about this that you want to use a lot
 of resources.  Are you?
 
 At 04:53 PM 6/19/2004, Bill Siggelkow wrote:
 AFAIK this cannot be done -- your best bet is to provide a Logoff link and
 a reasonable session timeout.
 
 ksitron wrote:
 Is there a way to detect when the user closes the browser.
 What I want to do is do clean-up and destroy the session.
 

  This will help you clean-up and destroy the session. If you already know
how to accomplish this... Then skip this reply... :)



  I don¹t know the objective you want to accomplish but I had to implement a
UserContainer that was session aware.
  All I had to do is implement the HttpSessionBindingListener on this class.

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/servletapi/javax/servlet/htt
p/HttpSessionBindingListener.html


  By default, when you destroy the session all attributes are destroyed but
not closed (example: a database connection may still persist but the session
itself doesn't).

  The best way to clean-up/close resources is to define a
ApplicationContainer with a

private Map map = new HashMap();

 and then implement something similar to HttpSession

public final void setAttribute(final String key, final Object value)
public final getAttribute(final String key)

and the 

public void valueUnbound(HttpSessionBindingEvent event)

you could also implement this method

public void valueBound(HttpSessionBindingEvent event)

to initalize container's configurations/resources.

When a user logs off you just to remove the ApplicationContainer from
session and the unbound method will be called.
When a session times out the ApplicationContainer will be removed from
session and the unbound method will be called.


Pedro Salgado


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Detecting browser close

2004-06-19 Thread ksitron
Thanks for the reply. But, I find it hard to accept that it can't be done.
And, users may not be computer savy  or follow good etiquette and log off.
Bill Siggelkow wrote:
AFAIK this cannot be done -- your best bet is to provide a Logoff link 
and a reasonable session timeout.

ksitron wrote:
Is there a way to detect when the user closes the browser.
What I want to do is do clean-up and destroy the session.
Thanks in advance.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Kevin J Citron
Sr. Object Imagineer
Optimized Objects, Inc.
EL Paso, Texas 79930
(915) 565-7785/566-2403

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Detecting browser close

2004-06-19 Thread mike
There are ways, if you are so adamant about this that you want to use a lot 
of resources.  Are you?

At 04:53 PM 6/19/2004, Bill Siggelkow wrote:
AFAIK this cannot be done -- your best bet is to provide a Logoff link and 
a reasonable session timeout.

ksitron wrote:
Is there a way to detect when the user closes the browser.
What I want to do is do clean-up and destroy the session.
Thanks in advance.

-
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]