how to close the application using java

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Oct 2007
Posts: 85
Reputation: hidash_in has a little shameless behaviour in the past 
Solved Threads: 0
hidash_in's Avatar
hidash_in hidash_in is offline Offline
Junior Poster in Training

how to close the application using java

 
-1
  #1
Dec 10th, 2007
hi masijade,
tell me how to close the application using java.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,416
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 257
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: how to close the application using java

 
0
  #2
Dec 10th, 2007
You can't. You aren't opening it with Java either. You are simply telling the browser what is being sent (the content type) and letting the browser decide how to display it. In this regard, Java has nothing to do with it.

Assuming that this question is related to
http://www.daniweb.com/forums/thread100436.html
Last edited by masijade; Dec 10th, 2007 at 4:02 am. Reason: typos
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 85
Reputation: hidash_in has a little shameless behaviour in the past 
Solved Threads: 0
hidash_in's Avatar
hidash_in hidash_in is offline Offline
Junior Poster in Training

Re: how to close the application using java

 
0
  #3
Dec 11th, 2007
k,
see i can open an application from jsp page through java coding now i want to close that opened application from the same jsp page through java.
can u understand my question.
if yes, send some related codes for this problem.
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,416
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 257
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: how to close the application using java

 
0
  #4
Dec 11th, 2007
But, you are not opening the application with Java. That is exactly what I said in the last post. You are simply setting a content-type type (and filename with extension since windows is stupid enough to need this info) and then passing the file through byte for byte. How the file gets displayed on the client is determined by the browser.

I tell you what, change your file settings remove the ".xls" association. Then access an excel sheet using your JSP and tell us what happens. The browser displays a bunch of BS in the browser, rather than using excel to display the sheet, doesn't it?

Like I said, you are not opening excel on the client in your Java code, you are simply letting the browser know what it is you are sending, and the browser is deciding how to open it.

It's not that hard to understand.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1
Reputation: siriussnivelle is an unknown quantity at this point 
Solved Threads: 0
siriussnivelle siriussnivelle is offline Offline
Newbie Poster

Re: how to close the application using java

 
0
  #5
Jul 16th, 2008
heyy, but do u know how to close internet explorer using java program, which i opened using the syntax:
  1. Runtime.getRuntime().exec(browserCommand+" "+Url_name);

Please let me know guys.. I want to know..
Sirius
Reply With Quote Quick reply to this message  
Join Date: Feb 2006
Posts: 2,416
Reputation: masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of masijade has much to be proud of 
Solved Threads: 257
Moderator
masijade's Avatar
masijade masijade is offline Offline
Nearly a Posting Maven

Re: how to close the application using java

 
1
  #6
Jul 16th, 2008
  1. Process p = Runtime.getRuntime().exec(browserCommand+" "+Url_name);
  2. p.destroy();
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 111
Reputation: ChaseVoid is an unknown quantity at this point 
Solved Threads: 12
ChaseVoid's Avatar
ChaseVoid ChaseVoid is offline Offline
Junior Poster

Re: how to close the application using java

 
0
  #7
Jul 19th, 2008
What `masijade` is trying to say is that, JSP is a server - side scripting language. You can't only affect the server with it, to control the client side, you need to use a client-side scripts such as JavaScript, etc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC