How to trap client browser window closing thru JSP or servlets

How to trap client browser window closing thru JSP or servlets?
Gunjan

Hi
Though some JavaScripts may provide you with solutions , yet there is no reliable way to detect the closing of the browser by the servlet. One way to achieve detection of user quitting a session is setting session timeouts ion the server side. This can be done either through the web.xml file or programatically by setting the session.setMaxInactiveInterval().
Good Luck!
Eshwar Rao
Developer Technical Support
Sun microsystems Inc
http://www.sun.com/developers/support

Similar Messages

  • Browser window closing

    Hello,
    How could I close browser window from jsp code?
    Probably I have to use JavaScript. But, window.close() doesn't work.
    May be someone has some ideas about this topic?
    /Aljoha

    I need to open a confirmation window on the click of a command button(Exit without saving). If the user clicks Ok on the popup confirmation, then the main form window should be closed. If user presses cancel, then there's some other action to be performed to reload the page. (The form itself is in jsf . So the bean method in action takes care of the cancel part).
    This is the snippet of code for the 'Exit without saving' command button. It works fine in Camino and Mozilla, but has problems in IE and Safari. Can somebody suggest an all-browser compatible way of doing this?
    thanks
    sowmya
    <h:commandButton id="exit_wos"
    value="Exit without saving"
    onclick="window.close();"
    immediate="true"
    type="submit"
    action="#{annotationMainBean.exitAction}"/>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function
    closeWindow () {
    var x = confirm('Are you sure you want to exit?');
    if(x == true) {
    window.close ();
    //--></SCRIPT>

  • I need to know how to expand the browser window so it fills my laptop screen

    i need to know how to expand the browser window so it fills my laptop screen this isnt  about the + or - tabs

    have a look at the top left of your browser window that looks like two arrows pointing up and down in a slant, click it and it will put your browser in full screen mode...

  • How to close child windows when parent window closed in jsp

    how to close child windows when parent window closed in jsp
    becoz it can't be able to recognise it's parent
    with the whole application
    plz send me some sample code of it

    Hi, I have no idea how to do this is JSP.
    However createing a modal window (with javascript) would mean that the user can not use the parent window untill he closes the child window. However not sure if this is what you are searching.
    Otherwise you can detect the onClose (I think) and close the window from there.
    However both the above are JavaScript and not JSP.
    rwgards,
    sim085

  • How to open a new browser window from a JSP page?

    Hi,
    I am picking up records from the database and displaying each record in a seperate text area field using the JSP code. I should be able to display the content ( available in the text area) in a seperate window if the user clicks on one icon.
    Is it possible to open a new browser window using JSP? If yes, how can I write information on the new browser window?
    Thanks in advance.

    Is it possible to open a new browser window using JSP?a JSP page is also an HTML page, this is client side stuff, you can do it with JavaScript.

  • How to open new browser window on click of command button

    Hi,
    We have a requirement to open an image in new window when a command button is clicked. Is there any sample explaining how to do that?
    Thanks in Advance,
    Pradeep

    Hi,
    I have to load an applet viewer in the new browser window. I have URL to the PDF.
    I ma able to load the applet viewer in new browser window using javascript. But I have to load the new PDF if the same window in already opened.
    The issue here is , i am loosing the window handle if the parent page is refreshed. I want to store the window handle in session scope variable and use the same.
    How do i update the session scope variable using javascript?
    Thanks and Regards,
    Pradeep

  • How to close one browser window and return to a named anchor on a page in another window

    I'm working on a website that has several book images at the bottom of each page. I have set it up so when the user clicks on a book another smaller browser window opens up with a description of the book. At the bottom of book description window, I have a close button which I added the window.close() behavior to. But I'd like to not just have the window close but return the user to the bottom of the original page where I have the books, an area that I have applied a named anchor to. Any ideas on how I can get this done.
    I'd appreciate any and all help.

    I haven't tried to customize this lightbox extension much.  But I'm pretty sure the size of the box is pre-determined by image size.  Bigger image, bigger box.  And that is coded into one of the Lightbox javascript libraries.
    As to placing a link in the caption, sure.  Just paste your html link code into the Lightbox Caption Panel like so.
    <a href="http://amazon.com"> Buy now from Amazon</a>
    There is much more detailed information about Lightbox and how it works at the huddled together website.
    http://www.huddletogether.com/projects/lightbox/
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb

  • How to maximize a browser window?

    Can't seem to figure out how to make a Safari window fill the entire screen.
    Or how to vertically or horizontally tile Safari windows.
    Or a keyboard shortcut to maximize a window I'd hidden previously.
    Or how to get my browsing history to display in a convenient always-on-screen tab. Or even how to access the History dropdown menu without using the mouse constantly, which used to save me so much time and hand/arm movement.
    ...All things that were remarkably simple in IE and that I took for granted until a day or two ago.
    Message was edited by: par larsson

    Hello par:
    Sorry, incidentally, for my snippy post. It was 11:30 last night, and I think I was tired. Apple users who have been through the bad and good times tend (me too) to be a bit defensive (and yes, superior) to any comparison of Apple software to the stuff from the behemoth from Washington. As a bit of background information, Microsoft used to support a version of IE for the Mac. They dumped that about three years ago. Many of us (me too) hunted for options and I fell in love (figuratively speaking) with Safari.
    I use Firefox once in awhile as an alternate browser. There are a very few web sites that do no play well with Safari. The developers either do not write to standards or, worse yet, use code that is Microsoft-specific. Firefox is pretty friendly and has a feature that, when you first install it, allows you to import all of your bookmarks.
    F9 allows you to show all of the open windows at once (ones that are hidden under other windows.
    F10 brings all windows (except the active one) to the front.
    F11 hides all open windows.
    I am the world's slowest typer, so I use the mouse extensively (for me, oddly enough, it is faster).
    One nice thing you will find about software written for Apples (OS X) is that code is not shotgunned all over your system (unlike Windows). When you wish to uninstall something without an "uninstaller," a simple "find" will locate all the pieces of the program. Then dragging to trash dumps it. By the by, while I am giving gratuitous advice, do not delete any system software unless you are sure it will not harm other parts of OS X.
    I am like you in the sense that I avoid cluttering up my iMacs with a whole bunch of code. In my case, (touching wood) I have not had a software problem for a couple of years. Apple's pre-release testing has significantly improved.
    P.S. Ask away if you have questions in the future. You will find, I think, that this is the best on-line community anywhere - and virtually everyone is a volunteer.

  • How to bring the browser window from background/minimized to on top of all windows in Flex

    Hi I have the requireemnt where based on some condition I am opening a JSP in a new window  by calling
    navigateToURL(myFormData, _MYWINDOW);
    Calling this will open a new browser window. My requirement is when the new window if  minimized or behind other windows, how can I bring this window(MYWINDOW) infront of all the windows using JavaScript in Flex.
    In which file under html-template do I have to write my JavaScript function.
    Any help on how to call JS from Flex and handling in JS is  very much appreciated.
    Someone please share with me if there is any sample code. Thanks in advance

    hi
    to communicate with javascript, use ExternalInterface (see http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/external/External Interface.html for an example)
    you can add your JS directly to the index.template file or create a separate JS file and add the link
    not sure what JS you would use to bring window to front but i am guessing there is something...

  • How to get Client(browser) current date/time in BIP report

    Hi,
    I need to display report generated date in BIP report and this should be client(browser) current date/time. I tried the following things.
    1. have used MS Word Native Date/time using Insert->Date/Time. And we have chosen the M/d/yyyy h:mm:ss am/pm format. but it is printing BIp server date/time, not client date/time.
    2. <?xdofx:sysdate?>, <?xdoxslt:sysdate_as_xsdformat()?> and <?format-date:xdoxslt:sysdate_as_xsdformat();'SHORT_TIME'?> are giving GMT Date/Time, but we need client Date/Time.
    3.<?xdoxslt:sysdate('DD-MON-YYYY HH12:mi:ss')?> is giving the system date/time of the machine where BIP server is installed.
    Could you provide some help in this??
    Thanks
    Hari

    Hello, Hari,
    what would return something like this:
    Execution date:
    <?xdoxslt:current_date('ja-JP', 'Asia/Tokyo')?>
    <?xdoxslt:current_time('ja-JP', 'Asia/Tokyo')?>
    @Vetsrini,
    for my opinion,
    in the countries where time is switching (winter/summer) using the hard coded time zones in the format-date() cause a problem:
    for example:
    if we enter the date in date prompt in summer it will return PM_DT = 2010-07-20T00:00:00.000+04:00
    in winter 2010-07-20T00:00:00.000+03:00, so,
    using <?format-date:PM_DT;'DD.MM.YYYY';'GMT+3'?> return 2010-07-20 in winter and 2010-07-19 in summer.
    regards,
    Eldar A.

  • How to maximise the browser window in Forms 9i?

    I want to maximise the MDI window in an Oracle 9i Form. Many posts here say to use:
    Set_Window_Property(Forms_MDI_Window,Window_State,Maximize);
    but it doesn't work for me. Some posts suggest there is a bug that prevents it from working. If this is the case, is there some javascript I can run to do this for me? I am already using javascript to close the browser window when I am finished with the form, so a little more wouldn't hurt.
    thx
    adam

    When you are running inside the browser, you have no MDI window to maximize. (But there is a frame size that is set on the URL line or in the config file, which cannot be changed from the form).
    <p>When running SeparateFrame=True, you have an MDI window, and if you issue the maximize, Forms will set it to cover the full screen, but it will NOT be maximized.
    <p>And if you use get_window_property, it will always report window_state=normal, even if the user maximizes the window.
    <p>See MDI Window State in web forms

  • How to open the browser window of the user to the size of the webpage ?

    Hello,
    My webpages are 1000 x 600 pixels, and I would like the browser window of any user opens in that size for he can see the website as I want to. Is it possible ? I guess it is because the pop-up windows of a "photo page" open to the size of the pictures (when you click on the miniature pictures), so iWeb should have this possibility.
    Can you help ?
    Thank you very much.
    Julien

    Here are some basic instructions for making html changes after publishing in iWeb:
    1. Publish your site via iWeb
    2. Find your html files.
    Go to iDisk/Web/Sites/iWeb/Sitename/Pagename.html
    (If you publish to a folder, look in the folder you selected or try looking in your Sites folder of your home folder. )
    There are two ways to handle accessing your iDisk.
    Method 1:
    Turn on local copy of your iDisk in System Prefs, with or without automatic syncing.
    If you publish your site via iWeb, now the updated pages exist online but the old pages are on your local iDisk. You need to sync (automatically or manually) to get the new pages on your local iDisk (on your computer).
    Then you can open the updated files, make your html changes in Text Edit or whatever program, and SYNC AGAIN (automatically or manually) to update the online version of the site to match what you have just changed on your local iDisk
    Method 2:
    Mount the iDisk when needed via the "Go" menu in Finder. This is the ONLINE VERSION of your iDisk, not a local copy. When you publish your site via iWeb, the changes INSTANTLY appear on the iDisk on your desktop. If you make html edits or other changes, they appear INSTANTLY online.
    I recommend Method 2 - much easier!!!
    3. Make the html changes.
    You can open the html files generated by iWeb in any text or html editor. In TextEdit, to view the code in an HTML file, choose File > Open and select "Ignore rich text commands." Then locate the .html file (as described in step 2) and click Open.
    Make your changes (i.e. follow the directions on the link provided by James - it worked for me when I entered that page, so the 2000 suggestion still works!) and don't forget to save your changes (not Save As, just Save)!!!
    4. Remember, if you make a change to a page like this post-publishing, and later re-publish, you have to make the html changes again! Set up a Find/Replace command in MassReplaceIt and you can do this very quickly. You can save your queries so you can make all of your changes with one click the next time you save.
    Download here:
    http://www.hexmonkeysoftware.com

  • Droid2 Browser Windows Closing

    Moved for greater exposure

    Hello NEHill,
    Please follow these steps to have more than one browser window open at a time.
    Go to the browser.
    To open up another window go to menu.
    Select Windows.
    Select New Window or a window you already have open.

  • Other Browser Windows closing

    Hello,
    I am having a problem with the JRE. I am using JRE 1.3.1_04 on Windows 2000 and IE6.
    If I already have browser windows open and launch my java applet from a shortcut on my desktop, IE seems to launch this new browser in the same process as the already open browser windows, and the JVM attaches itself to both browser windows. So when I do a system.exit(0) all browser windows close.
    This poses a major problem for me as the users will be launching this applet from either a shortcut on thier desktop or a link from another Web application (which is set to open in a new window). In both these cases windows will open a new browser in the same process.
    Any help would be greatly appreciated.

    You should not use System.exit() from applets. And Sun should have not allowed you to do so. ;)
    By the way:
    1. I saw a checkbox somewhere in Explorer settings: "Reuse explorer windows when launching shortcuts".
    2. Why not to use an applet viewer instead of IE? It will run as a separate JVM.

  • Opening a new browser window from a JSP

    Hi,
    I have 2 buttons on my JSP. When the user clicks on them, they produce 2 reports. I would like to produce these results on a different browser window. Can anyone please tell me how to open a new window for the results?
    Thank you in advance.

    Use target="_blank" in your form declaration.<FORM METHOD=POST ACTION="someAction" TARGET="_blank">The _blank keyword tells the browser to load the results in a new window.
    If you need more control over your window (size, address bar, etc.) you'll need to use javascript.<SCRIPT>
    function submitForm(windowName){
       newWin = window.open("",windowName, "menubar=no,resizable=no,...");
       document.myForm.target = windowName;
       document.myForm.submit();
    </SCRIPT>
    <FORM NAME="myForm" METHOD=POST ACTION="some.jsp" TARGET="">
    <INPUT TYPE=BUTTON VALUE="Submit" onclick="submitForm();">
    </FORM>

Maybe you are looking for

  • Replacing power supply in G4

    This isn't totally on topic, but it's the closest I can find in the discussions. I run several macs on ethernet. I have an old G4 Power Mac, dual processor, 500mhz Model M5183, which I use to run a flatbed scanner. The scanner software can only use O

  • HT204053 WHY IS MY APPLE ID DISABLE?

    WHY IS MY APPLE ID DISABLE?

  • Error installing windows 7 on partition with Bootcamp.

    I'm having issues when I try and istall Windows 7 using bootcamp on my Macbook Pro 15' Retina Late-2013. I am able to create the USB Key with Windows 64-bit and Support files from apple with no issues. For this, I'm using a ScanDisk Extreme 32Gb USB

  • Itunes don't reconize my iphone

    I have a 3s Iphone and now my Itunes does not detect it.  I have pics I would love to download without having to e-mail them.  Please help me......

  • IMac G5 failed 10.5 update - won't boot now, spinning wheel

    Please help, I bought my mom an iPad because she broke both ankles and is gonna be bed ridden for several weeks, and needed some way to get email, etc. She has an iMac g5 2ghz non iSight. The iPad needs to be plugged into iTunes to work the first tim