Session problems due to abruptly closed browser window

Hi
We have an application running which uses JSP,struts , tomcat and JMS. When the user logs in we store some values in the session which are very critical for the application to function. we have kept a logout button thru out the application. After pressing the logout button those values are cleared from the data structure we maintain at the application scope. But if the user closes the browser window then those "clearing" operations dont take place which causes critical problems.
can anybody suggest anything on this situation ?
Martin

Yes, have a session timeout value set and write a SessionListener that cleans out the cache whenever a session is invalidated.
%

Similar Messages

  • Popup to confirm when closing browser window?

    Hi
    I want to display popup confirm window when closing browser window, "changes will be lost" yes or no. for this i searched forums got some idea, about "WORK PROTECT MODE". this will work only when our application running from portal. my doubt is where should i write code for this??? any help
    Thanks,
    kris.

    Hi Thomas,
    We are on ECC6.0 enph5.
    In system configuration in epc.loader(service) the value for work protect mode is set as 1 - Protect unsaved data (open page in a new window) 
    1)Is it possible to override this value within WD ABAP application? for example show popup window when there is unsaved data
    2)In this scenario what is the significance of L_PORTAL_MANAGER->SET_WORK_PROTECT_MODE
    and   L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG
    3)Where exactly  L_PORTAL_MANAGER->SET_APPLICATION_DIRTY_FLAG has to coded. It does trigger modify method of the view.
    Thanks,
    chamu

  • How to show a confirmation when closing browser window in jdeveloper11g

    Hi
    I'm Using Jdev 11g
    How to show a confirmation when closing browser window in jdeveloper11g
    Regards
    Abhilash

    Abhilash,
    My goodness...
    Didn't search the forum, eh? In fact, didn't even look at the last 5 or 6 posts - this was posted by another user within the past few hours.... Giving a message while closing a jspx page.
    John

  • Problem in Closing Browser window from an Applet.

    I have wriiten a small Applet progarm that calls a Javascript function in the opening window, to close the window in which it is loaded.The Applet window is a PopUp window from one of my application's window.
    First time I start my application and load that Applet and then close the frame window,it works fine that the browser window will close, when the frame window is closed.It calls the window closing event in that applet stop method is called and In stop methd a closeLaunchedBrowser method will called this has a Javascript method and the Method closes the window using the self.close() method.
    But now if I continue this process of launching applet and then closing frame window, initial 1 or 2 steps it has know problem when I continue this, after 3 or 4 steps, it result in browser hang/crash.
    I am using java version 1.4.2_01 or higher and IE or Firefox(any other NetScape based) browser to load applet.It works fine with IE but getting problem in case of Firefox(any other NetScape based).
    The error dialog information and related event log generated is shown below :
    The dialog which is displayed before crashing of firefox has information :
    "firefox.exe has generated errors and it will closed by windows.you will need to restart the program.
    An error log is being created."
    The error log information :
    Source : Browser Event ID: 8032
    "The browser service has failed to retrieve the backup list too many times on transport \Device\NetBT_Tcpip_{611A64A2-8F4B-409E-9AB2-0D9BF741E791}. The backup browser is stopping.
    The code related to this is given below.
    import javax.swing.JApplet;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import netscape.javascript.JSObject;
    public class TestApplet extends JApplet {
    protected JSObject win = null;
    private JFrame frame = null;
    private boolean alreadyClosed = false;
    public void init(){
    this.win = JSObject.getWindow(this);
    frame = new JFrame("Test Frame");
    frame.setSize(300, 400);
    frame.addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
    TestApplet.this.stop();
    frame.show();
    public void stop() {
    if (!alreadyClosed) {
    alreadyClosed = true;
    closeLaunchedBrowser();
    System.gc();
    System.runFinalization();
    private void closeLaunchedBrowser() {
    final TestApplet thisObject = this;
    Runnable r = new Runnable() {
    public void run() {
    try {
    JSObject win = (JSObject)JSObject.getWindow(thisObject);
    if (win != null && win.toString() != null) {
    //win.eval("top.opener=self;self.close();");
    //win.call("close", null);
    win.eval("self.close();");
    } catch (Exception e) {
    Thread t = new Thread(r);
    t.start();
    }If any one know solution regarding how to aviod this crash of browser please let me know. I will be very thankful to you.
    Thanks.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Closing browser window when form is closed

     

    Thanks, Michael.  I agree about exit_form.
    I want the second browser to block the first set of forms running in the first browser because it's a dataflow requirement - user goes from Form A to Form B, must complete their work in Form B before returning to Form A.  So I'm actually happy that webutil_host.host freezes Form A.  I don't want to use non-blocking because this would let the user back in Form A before they were done with Form B (and would potentially leave a lot of browser windows open).  I did initally try web.show_document but that was non-blocking.
    Normally, I would use a call_form in this scenario, but I have to log into a second database (for security reasons) for the user to complete their task in Form B, and if I use a call_form and then want to log into a second database, I have to log out of my first one (which causes me to lose all sorts of global variables and session variables), log into the second, and then log back into the first (and I don't get my globals or session variables back in that case).  So, I am keeping Session 1 alive in Form A, calling Form B and starting Session 2 against a second database, and then closing Session 2 and Form B and returning to Session1 (which is still open)and Form A.  Is there is a better way to do thise, please let me know.  (Mind you, this all worked very well in client/server mode - funny how the older tools can be more straightforward.)
    And yes, I agree that we are using an old OAS (OAS10gR1).  I have been suggesting an upgrade but am being told that it would require too much effort.  We have 200 forms and upgrading them to work with the newer OAS is something I have been told we cannot do.  If it doesn't require a forms upgrade (beyond open in new builder, save, and close), then I might have some luck making it happen, but everyone seems to think it does require more work than that.  If that is not true, please let me know.  I think that would solve a lot of our problems.
    Meredith

  • Trigger Javascript when closing browser window from CP8

    I worry this isn't possible but here goes....any help would be incredible.
    Recently I was given some great advice on how to trigger a Javascript action in the frame on our LMS which the Captivate file plays in.
    It works perfectly and on the final page triggers the Javascript which send usage back to the LMS and forward the user to a page which allows them to rate the course.
    The code was as follows:
    top.code.closeSCOContent();
    closeSCOContent() is something written into our LMS.
    However the obvious issue occurs when a user just closes the browser window and for some reason our LMS doesn't record any bookmarking or any data.
    The only way it seems to do this is if that function is called.
    So using the window.onunload() or the DOFinish; function is there a way I can edit any file in the Captivate output to trigger this function when closing the browser?
    Long shot I know but currently the best I have managed is getting the course to trigger this as soon as it loads rather than closing the window?
    Massive thanks in advance for any advice.

    Any solution to ensure the data is written back to the LMS would solve the issue.
    Currently when the close button is pressed nothing happens at all and it's a big problem.
    Triggering this .closeSCOContent() function would be the ideal, but if it's not possible anything to write back would be best.
    When you say <body onbeforeunload="top.code.closeSCOContent();">
    Do you mean putting this in the HTML file of the output which currently is:
    <body bgcolor="#f2f2f2">
    and change this to:
    <body onbeforeunload="top.code.closeSCOContent();" body bgcolor="#f2f2f2">

  • Maximize and closing browser window

    Hi all.
    I have two problems.
    I'm running a form in separateframe =true. I want to maximize the browser window. How can I do this???
    The second problem: how can I close the browser window? I have create a post-form trigger and I put this code: web.show_document('JavaScript:window.close();','_self');
    but nothing appens. Is there someone that can help me???
    Thank you all,
    Fabrizio

    For closing the browser window after closing a form you need to create an html file with the following code in it.
    for Internet Explorer:
    <html>
    <body onload="closeit()">
    <script>
    function closeit()
         win = top;
         win.opener = top;
         win.close ();
    </script>
    </body>
    </html>Place this file where Oracle HTTP server can read (virtual directory) and call in in a post form trigger with web.show_document.
    WEB.SHOW_DOCUMENT('http://machinename.domain:portno/mydirectory/close.html',
    '_self');Make sure you use _self to the close the applet browser.
    You can sue the same method to maximize the browser window too with the appropriate code.
    Regards,
    Tony

  • Prompting users for confimation when closing browser window

    Hi All,
    I would like to prompt the user with a popup-screen asking for confirmation that he wants to close the browser when hitting the browser-close ('X') button. Is this possible ?
    If the user chose to cancel the browser window shoud remain open, with all content as it was... and of course if he chooses to continue the window should just close.
    the WDA app is straight forward, and not running inside the portal.
    Thanx in advance
    -Tonni

    Hi Tonni,
    I thought I should add - the portal does implement a work protection mode that does allow you to prompt users if they navigate away from your page - and one of the best ways to implement that is through the FPM and its work protect mode interface.
    However, that still doesn't help, I'm afraid, in the case where you're trying to stop the user closing the browser window...
    I should also point out that some browsers do indeed produce an event which can be trapped on close of the window, and have been hugely exploited by website designers - to the extent that later/better versions no longer support it. Remember the web pages that when you closed spawned 3 more, and those 3 more etc. etc.
    Cheers,
    Chris
    edit:  also worth pointing out that the "Close" button provided within a portal session by the FPM is a form of navigation and can be trapped. Likewise any internal navigation button that perform the same sort of thing within your app.
    Edited by: Chris Paine on Mar 29, 2010 3:08 PM

  • Closing browser window with Javascript

    In our Forms application, we have been using a line of Javascript in POST-FORM to close the browser window after the form is closed. After installing Windows XP SP2, this no longer works and my understanding is that putting the code in a standalone HTML file, and calling this file from POST-FORM will work.
    1. Where does this HTML file reside? My guess is
    {ORACLE_HOME}\forms90\server
    2. How is this script invoked? I guessed it would be
    WEB.SHOW_DOCUMENT('close.html').
    I'm clearly wrong, as this does not work!
    Many thanks in advance.

    You might also want to look at the following thread:
    Re: IE message "The web page you are viewing is trying...
    It refers to the addition of some JAVASCRIPT to your formsweb.cfg file which resolves the problem of the IE message "The web page you are viewing is trying..." from being displayed. It still may not work if you are running seperateFrame=True though, I have detailed the problem I'm experiencing in the associated thread.
    I'd be interested to hear if you can get round the display of the message if you are running in a separate frame.
    Richard

  • Closing browser window from an Applet?

    I've written a series of applets that perform different functions. I placed a button on each applet with the purpose to close the window in which that applet is running. However I don't even know where to start looking to find out how to make my applet close it's own browser window. I know how to open a new browser window from an applet but not vice versa.
    Can anyone help please?
    Mark.

    Right, I sort of tracked down some code that uses getMethods to allow me to invoke a Javascript command. It is not pretty and took a little bit of editing to get to work but it does the job without putting JS stuff into my HTML.
    However it is causing some problems. If I open one of my other applets it will only let me close that window and the previous applets ceases to respond at all. I think this may be because the invoke gets the JSObject which is the window and somehow having more than one applet open in different windows is causing it to get confused and is locking the first window and only responding to the second.
    I have seen a much simpler method that uses:
    import netscape.javascript.*;
    and JSObject to get the window but my compiler complains about the import. Any further suggestions or an example would be welcome as my current solution is a bit limited as you can effectively only have one window open at a time which doesn't suit my needs.
    Many thanks.
    Mark.

  • Cache problem for servlet opening new browser window

    Requirement:
    I have JSP page say summary.jsp with link "print account summary"
    When user clicks on this link, new browser open with PDF document of summary.jsp
    This new browser window should not have address bar and toolbar.
    Solution:
    Servlet called PrintSummary which sets contenttype=application/pdf and sends the data to outputstream.
    href of link is
    Java script function is:
    function openWindow(url){
    window.open(url,'blank','toolbar=no')
    Problem:
    Since the URL of this new window is
    http:// host:portnumber/PrintSummary
    Even if I click the "Print summary" link for account2,
    being the same URL (http:// host:portnumber/PrintSummary) it accesses the existing page in the cache which is created for account 1.
    In href if I just use servlet url as
    I get the expected behaviour but then I don't have control on browser appearance and browser window will be with address bar and toolbar.
    The only option I could think of was changing URL as follows:
    <% String url ="javascript:openWindow('PrintSummary? var1="+ Math.random()+"')";
    So that URL is different all the time
    Is there any way to solve this problem?
    Thanks in advance
    M.

    I'd definitely try to use a Flex popup... but the
    flash.net.navigateToURL method is a simple way to open a popup
    window in a new browser. You can pass any data needed by the new
    page using the URLRequest and/or URLVariables. The URL you navigate
    to could, of course, be another Flex application if necessary. I
    use this only when I need to open a popup window on another site,
    or an HTML formatter report or something similar.
    Concerning yourself with the size of the popup window may be
    a bad design choice also. I, for example, have my browser
    configured to open all popups in a new tab regardless of sizing
    constraints imposed by the designer. If it is absolutely necessary
    for you to have control over the size of your popup window, you
    should follow the advice given by others and use a Flex
    popup.

  • Webdynpro for ABAP not closing browser window after click Exit

    Hi Experts,
    We come across a minor problem when executing a Webdynpro for ABAP on our Production Portal.
    We have a "Exit" button which suppose to close the browser window with the webdynpro codes called but it failed to do so.
    The execution steps of the Webdynpro app:
         Click  "Exit"
         Click  "No"
         Results message in the browser:
    The code we use to exit and close the Web Dynpro application
    * Code to close the application when the WebDynpro is executed
    * as an independent application
    * Also requires an Outbound Plug (GO_EXIT) in the main Window
      data : lr_ref      type ref to ig_main_window.
      lr_ref = wd_this->get_main_window_ctr( ).
      lr_ref->fire_go_exit_plg( close_window = abap_true ).
    What would be the issue causing this, the Webdynpro codes or Portal config?
    Our systems are SAP NW 7.31 with:
    ECC6 (Basis 731 SP10)
    Portal (Basis 1000.7.31.7.0.20130227234100)
    Thank you for your help & advise.
    Derek Phung

    Hi Tashi,
    Thank you for your quick response & help.
    According to your more info link, the check will return ABAP_TRUE as the webdynpro app is ran on Portal.
    Sorry i should have mention that I got it working on our Dev & Test portal but now forgotten how i have done it, we now need it config for our production portal. I have vague memory collection that i config it somewhere on the portal, maybe one of the Application Modules in NWA?
    Any advise, help, hints would be very much appreciated.
    Thank You & regards,
    Derek

  • Web delivery inconsistencies /Closing browser windows

    I have a huge piece being web-delivered. Sometimes everything
    works perfectly, but occasionally we get a "Error reading segment
    file" or "file is damaged or not an Authorware file" message. Is
    there a solution for this problem?
    Also, is there a function or a way to close a browser window
    when you are ready to quit a web-based Authorware piece. If so,
    does it work if your piece is playing "onTop" rather than "in
    place"?
    Thanks!

    We have solved this by having the Authorware file call
    another HTML file that has a javascript:window.close() in it in the
    onLoad behavior (works for PC and Macintosh)
    We also have our Authorware pieces onTop and it works great!
    I have included the entire HTML code we are using. Just know,
    that if this is the only Browser window open, that It will come up
    with a window box something like ("..This windows is trying to
    close. Close the window YES/NO?")
    Hope this helps.
    Julia
    <html>
    <head>
    <title>Close the Browser Window</title>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1">
    </head>
    <body onload="javascript:window.close()">
    </body>
    </html>
    -----------------------

  • Help!! Closing browser window when form closes

    We have migrated from forms 5.0 to Forms 6i, running the forms on FormsServer 6. When I click on the exit button which executes exit_form, the applet window area clears and the browser window remains open. Is there a technique to close the browser window?
    Thanks in advance,
    Ed
    [email protected]

    Hi there,
    Write a Post-Form trigger with the following line of code:
    Web.Show_Document('teclose.html','_self');
    The code for teclose.htm is as follows:
    <html>
    <body onload="closeit()">
    <script>
    function closeit()
    window.close();
    </script>
    </body>
    </html>
    Don't forget to include the path in web.show_document to access the teclose.htm. See the
    help on web.show_document in forms help.
    Hope that will solve your problem.
    Thanks
    Pranati

  • On closing browser window i want to update database

    I an doing it by onUnload of javascript i poping up jsp and doing database transaction there . But probelm I encountered is when page is refreshed then also this script is poping up window and doing transactions which i don't want .
    Please help out this , Very Urget
    Mohan

    thanks for U reply
    But my application it is like this a person is given with login screen after login is valid i am enter in to window having 3 frames . I am updating database on login . if user closed the window by windows cross button then database status should be updated .
    Please solve this .
    And onUnload is not working in Nescape 4.7
    Mohan

Maybe you are looking for