954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

how to close the application using java

hi masijade,
tell me how to close the application using java.

hidash_in
Junior Poster in Training
86 posts since Oct 2007
Reputation Points: 1
Solved Threads: 0
 

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

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

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.

hidash_in
Junior Poster in Training
86 posts since Oct 2007
Reputation Points: 1
Solved Threads: 0
 

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.

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

heyy, but do u know how to close internet explorer using java program, which i opened using the syntax:

Runtime.getRuntime().exec(browserCommand+" "+Url_name);


Please let me know guys.. I want to know..
Sirius

siriussnivelle
Newbie Poster
1 post since Jul 2008
Reputation Points: 10
Solved Threads: 0
 
Process p = Runtime.getRuntime().exec(browserCommand+" "+Url_name);
p.destroy();
masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 

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.

ChaseVoid
Junior Poster
116 posts since Aug 2007
Reputation Points: 40
Solved Threads: 12
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You