Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Java   »   Closing jsps from an applet

 
Question Tools Search this Question Display Modes
Question
 
 
#1  
Old Jul 22, 2008, 09:48 PM
kirangudigar
New Member
kirangudigar is offline
 
Join Date: Jul 2008
Posts: 1
kirangudigar See this member's comment history on his/her Profile page.
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.

Reply With Quote
 
     

Answers
 
 
Old Jul 31, 2008, 09:27 AM   #2  
jstrike
Full Member
jstrike is offline
 
Join Date: May 2007
Location: Wisconsin - Go Packers!
Posts: 389
jstrike See this member's comment history on his/her Profile page.
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."); }
  Reply With Quote
 
     


Question Tools Search this Question
Search this Question:

Advanced Search
Display Modes

 
Similar Sponsors

Similar Questions
Question Asker Topic Answers Last Post
Adjusting entires, closing entries, post-closing trial balance Lizl Finance & Accounting 4 Jun 17, 2008 12:17 PM
Preparing Closing entries & Post Closing Trial Balance michelek Finance & Accounting 1 Feb 22, 2008 06:36 PM
Write an applet to show permanent passion between HTML and applet? pcrao Other Programming 0 Jun 16, 2007 06:40 PM
Java Applet upgrade jl2570 Computers for Beginners 1 Dec 12, 2006 08:04 PM
Writing an Applet pranirdhal Other Programming 1 May 29, 2006 11:58 PM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 02:15 PM.

Content Relevant URLs by vBSEO 3.0.0 RC6 © 2006, Crawlability, Inc.