Ask Experts Questions for FREE Help !
Ask
    kirangudigar's Avatar
    kirangudigar Posts: 4, Reputation: 1
    New Member
     
    #1

    Jul 22, 2008, 10:48 PM
    Closing jsps from an applet
    I have an applet which launches the jsp in a new window using showDocument method.
    When I exit from an applet, all jsps launched from an applet should also get closed.
    jstrike's Avatar
    jstrike Posts: 418, Reputation: 44
    Full Member
     
    #2

    Jul 31, 2008, 10:27 AM
    You would need to code something in JavaScript to close the window but since the jsp window was not opened via JavaScript it's going to be tough to close it. (This is a JavaScript security feature) You can jump through some hoops and get it to work in IE but FireFox, from what I've seen, flat out won't let you do it.

    In spite of that limitation here's my suggestion:

    Right before you launch the JSP page make a call to a servlet and put a variable in the session called something like applet_open, set the value to yes, true, or something else to indicate that the applet is open.
    On the JSP page use DWR (DWR - Easy Ajax for JAVA | Direct Web Remoting) or AJAX to make a call to the server to check that value. If it's not what it should be or the session is null then try to close the window.
    Right before the applet closes make a call to the servlet again and change the value.

    When you try to close an IE browser with close() expect a message about the window closing, FF3 will not prompt you, it will just return an error from the command. You might want to try something like this:
    Code:
    try {
       window.close();
    }catch(e) {
      alert("Please close this window manually.");
    }

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Adjusting entires, closing entries, post-closing trial balance [ 12 Answers ]

I need to know what an adjusting entry, closing entry, and a post-closing trial balance look like. I will give you the figures of you need them.

Preparing Closing entries & Post Closing Trial Balance [ 1 Answers ]

I don't quite understand how you incorporate the information into these accounts. For instance, you have Capital $9,000; Wage Expenses $8500; Service Revenue $1000; and Rent Expense $1600.

Java Applet upgrade [ 1 Answers ]

I downloaded the java 1_05_09 but in the advanced menu of IE tools it says requires restart... I have restarted with no luck. Anyone know anything about it?

Writing an Applet [ 1 Answers ]

Write an applet to show permanent passion between HTML and applet ? Thank you so much for helping me to find out the answers in advance :)


View more questions Search