So, do you want Java or JavaScript? You seem to be using them interchangeably, which they are not. They are two completely separate things.
And, you are neither opening, nor closing, applications on the client (i.e. through the browser) from the server in either JSP or Servlets. All you are doing to "open" the app is sending the content. The browser is "opening" the app, but it could, depending on its content associations, do something entirely different.
You may, and I stress may, be closing something using JavaScript (although I doubt it), but definately not with Java. And if you claim to be, please post that code, as I do not believe it (except maybe with an Applet with all security policies opened up on the client, which would be possible, but I, if I worked there, would immediately stop working there, if that is the case).
And I do not have to tell you anything. So keep the demand of your last statement to yourself. You have been going on and on about this topic for months now, always insisting on being able to do something that you either cannot, or should not do (at least not the way you think it will work). The one time you actually (I believe by accident) did something right (in simply sending the content of the file to the browser after having set the content type and disposition headers and letting the browser decide how to open it) you claimed to have "opened" the application on the client, regardless of how many times you were told that that is not what you did.
You don't seem to realise what the separation of client and server means. You don't seem to realise how a browser works. You don't seem to realise what security principles lay behind most of these restrictions. And you definately do not know how to accept advice.
I don't care what your "project" is. If it can do any of what you claim it can, then it is only through JavaScript (or some other client side program) which your server should never rely on since the clients will have the option of disabling it, and then your "program" doesn't work anymore, or by disabling the clients security through alteration of the security poilicies. Which simply makes those computers vulnerable to about a million different malicious routines, and would prompt me to leave the company (as many times it would be impossible for the employee to prove that some malicious, or just badly written program, destroyed months or years of work, rather than him/herself, and even if he could prove it, it would probably financially destroy him/her in the process).
I am not going to say anything else on this topic, as you just do not, and will take the time to, understand.