tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Adams <bad...@AEM-TX.com>
Subject RE: Invoking a process on the server from a servlet
Date Tue, 22 Jan 2002 15:33:34 GMT
Mark is correct.  If you want you can have the servlet write to a file every
time you get a visitor and then write a seperate program that runs in your
tooltray. The other program should read the file and when a new line is
written then popup what ever it is you want to see.
 If it is in the your tooltray then the program will only work when you
login. :)
the servlet will just write to a special log file that is read by your new
little monitoring program.
goodluck,
Brian

-----Original Message-----
From: Wagoner, Mark [mailto:MWagoner@wildflavors.com]
Sent: Tuesday, January 22, 2002 9:46 AM
To: 'Tomcat Users List'
Subject: RE: Invoking a process on the server from a servlet


The problem is due to NT (or 2000) not allowing the Tomcat service to
interact with the desktop.  If you bring up Task Manager, you will probably
see your invoked process running, but it can't create window.  In fact, the
only way you will now be able to get rid of it will be to kill it in Task
Manager.

I don't know of any way around this.

-----Original Message-----
From: Stephen Clarke [mailto:any@longusername.worldonline.co.uk]
Sent: Tuesday, January 22, 2002 10:42 AM
To: tomcat
Subject: Invoking a process on the server from a servlet


I have the following code in my servlet, where 'out' is the
HttpServletResponse object.

  Runtime t = Runtime.getRuntime();

  try {

   Process proc = t.exec( "c:\\TaskInfo.exe" );

   out.write(" invoked " );

  } catch ( java.io.IOException ioe ) {

   out.write( ioe.toString() );

  }

What I'm getting is "invoked" in the browser window, but nothing visibly
happens on my local machine( ie. server). I was hoping TaskInfo would start
up. What I really want to do is open a file in notepad to tell me a visitor
has just arrived. Am I barking up the wrong tree altogether. Should I
generate an event and listen for it in another app running as a listener in
the background, or is there just no way of invoking a process on localhost
from a servlet.

Thanks.

If this is the wrong place to be asking these questions, please let me know.

--
cf



--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message