i want to check the pid for a newly created process. i asked somebody they told to check it in the java native interface. but i didnt get the clear solution for this problem. can anyone is there to clear my problem..

10 Years
Discussion Span
Last Post by hidash_in

JNI is Java Native Interface. Read the tutorial provided by Sun on that. It allows you to use a native library (on unix an *.so file, on Windoof an *.dll, on other OSes I don't know the extension, off-hand) by writing a small "interface" to "translate" the functions in the library, to Java methods. How you would implement this to get process_ids depends on the library being used.

However, you still will not be able to get process ids of processes running on the machine from which the browser is located from your JSP/Servlet (which I know is still what you're trying to do). I really don't know how often you have to be told, that you cannot control what the the client does, or how it does it, from a JSP/Servlet.

A JSP/Servlet can only affect the server (and that is also limited as well, normally) and deliver content to the client. What the client (i.e. browser) does with that content is completely up to the client and not under your control.


k masijade i agree.. but see i having a project called wms (work flow management system) web based project.
in this project i have to check the workers efficiency by using the working time in an application. for that purpose i m getting the start and end time of the application. the application is opening through java program embedded in the jsp page. and also closing the application through java program embedded in jsp page
now come to my problem,
while i am opening a application the java script timer is started withouot knowing whether the application is opened or not. so i have to check the application started or not. if the application is open / not open the timer is starting. here, i have to start the timer after the application started. so for this purpose i have to check the application open or not.
now tell how to check the application open or not.

can u understand my problem???
if s, pls give me a clear solution...


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.

Votes + Comments
He just refuses to get it no matter how many times it has been explained.
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.