tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergio Stateri Jr" <>
Subject RES: [tomcat-devel] How to call Runtime.exec()
Date Thu, 05 Oct 2000 11:57:39 GMT
Here's a sample JSP that run any System command, since the user that run
Tomcat has sufficient rights...

PS : Send the command to be executed as the "command" URL parameter, like
this :


(see that the command must be URL Encoded...)

Sergio Stateri Jr
Tesla Tecnologia
Sao Paulo (SP) Brazil

<%@ page
import=	"*"


	String s;

	try {
	    Process myProcess =

	    DataInputStream in = new DataInputStream(
		new BufferedInputStream(myProcess.getInputStream()));

	    while ((s = in.readLine()) != null) {
		out.println(s + "<br>");
	catch (IOException e) {
	    out.println("Error: " + e);


-----Mensagem original-----
[]Em nome de Pankaj Malviya
Enviada em: Quarta-feira, 4 de Outubro de 2000 19:29
Assunto: [tomcat-devel] How to call Runtime.exec()


I am trying to start my application server ( If it has been killed or
stopped) from Servlet by using runtime.exec() and it is not working. Do I
need to make some changes in config file or somewhere to make this happen. I
read that to do this in iPlanet Web Server some config changes are required,
whether same is the case for tomcat.

Your early help will be highly appreciated.

Wondering why my application server dies. (It is killed by process watch on
the Shared Hosting Server).



To unsubscribe, e-mail:
For additional commands, e-mail:

tomcat-devel mailing list

View raw message