disable or disappear window's close button (JSP)

Discussion in 'Java' started by Vijaya, Feb 16, 2004.

  1. Vijaya

    Vijaya Guest

    I need to force the user to click the sign out button to close the
    window, that's cause i need to kill his session and when i do that on
    the onload of the body sometimes don't execute the method (javascript)
    that goes to the servlet that kill the session.

    Even if there is an server side event in Java, that will also be
    helpful. I am using Tomcat as the server.
     
    Vijaya, Feb 16, 2004
    #1
    1. Advertising

  2. Vijaya wrote:

    Hi Vijaya, there is no such group as..
    comp.lang.java.javascript, you may have confused
    it with comp.lang.javascript - a seperate language
    to Java.

    > I need to force the user to click the sign out button to close the
    > window,


    Easy. Stand beside them with a
    loaded gun. Say "Close that, and
    I'll shoot you". ;-)

    >..that's cause i need to kill his session


    ...a 'men only' site?

    There are probably good ways to
    achieve what you want, but you are
    pursuing the wrong strategy if it ever
    depends on actions by the user.

    Any such strategy *will* *fail*.

    [ And btw - anything involving JavaScript
    cannot be relied upon either. ]

    --
    Andrew Thompson
    * http://www.PhySci.org/ Open-source software suite
    * http://www.PhySci.org/codes/ Web & IT Help
    * http://www.1point1C.org/ Science & Technology
     
    Andrew Thompson, Feb 16, 2004
    #2
    1. Advertising

  3. Vijaya

    riotctrl Guest

    As an idea... an Onunload call might work to close the session also if they
    close the window down.


    "Vijaya" <> wrote in message
    news:...
    > I need to force the user to click the sign out button to close the
    > window, that's cause i need to kill his session and when i do that on
    > the onload of the body sometimes don't execute the method (javascript)
    > that goes to the servlet that kill the session.
    >
    > Even if there is an server side event in Java, that will also be
    > helpful. I am using Tomcat as the server.
     
    riotctrl, Feb 25, 2004
    #3
  4. Vijaya

    Tony Morris Guest

    "riotctrl" <> wrote in message
    news:iBW_b.611212$X%5.303990@pd7tw2no...
    > As an idea... an Onunload call might work to close the session also if

    they
    > close the window down.
    >
    >
    > "Vijaya" <> wrote in message
    > news:...
    > > I need to force the user to click the sign out button to close the
    > > window, that's cause i need to kill his session and when i do that on
    > > the onload of the body sometimes don't execute the method (javascript)
    > > that goes to the servlet that kill the session.
    > >
    > > Even if there is an server side event in Java, that will also be
    > > helpful. I am using Tomcat as the server.

    >
    >


    Impossible.
    There is no way to force a client to close their session - and to rely on
    such behaviour is a flawed approach.
    If you want to handle the case of a session closing (either manually or
    timing out), see javax.servlet.http.HttpSessionListener.


    --
    Tony Morris
    (BInfTech, Cert 3 I.T.)
    Software Engineer
    (2003 VTR1000F)
    Sun Certified Programmer for the Java 2 Platform (1.4)
    Sun Certified Developer for the Java 2 Platform
     
    Tony Morris, Feb 25, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RJN

    Disable WIndow close (X)

    RJN, Sep 27, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    7,829
    Kevin Spencer
    Sep 27, 2004
  2. Jeremy Bowers
    Replies:
    3
    Views:
    432
    jrlen balane
    Mar 14, 2005
  3. Gabriel - BR
    Replies:
    4
    Views:
    652
    Gabriel - BR
    Aug 25, 2006
  4. Iñaki Baz Castillo
    Replies:
    7
    Views:
    895
    Iñaki Baz Castillo
    Jan 12, 2010
  5. Shang Wenbin

    close current window using window.close()

    Shang Wenbin, Sep 1, 2005, in forum: Javascript
    Replies:
    10
    Views:
    395
    Gérard Talbot
    Sep 2, 2005
Loading...

Share This Page