tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher St. John" <>
Subject Re: Running external processes...
Date Wed, 10 Sep 2003 15:44:13 GMT
Martin Mauri wrote:

> I'm building a webapp with JSP and I need to run an external shell process
> on Linux...I don't know if this is implemented by the Servlet/JSP API , can
> I call it in the normal way like "System.exec()"?? or it won't worj?

  It depends on the security settings. Out of the box on Tomcat, it
shouldn't be a problem. Will you be administering the servlet container?

  In any case, I'd recommend writing a quick servlet or JSP that
does a System.exec(), just a "hello world" kind of thing, to get the
hang of it. You need to be careful to do things like drain the output
stream from the process, otherwise it might hang. Permissions and
paths can also be a bit tricky, but a quick google for "System.exec()"
ought to get you some informative hits. Keep in mind when you test
that the final deployment environment could be quite different than
your test environment (different user running Tomcat, different paths,


View raw message