alebu wrote:
Hi!
How to run Perl script from tomcat ( no apache ) on windows?
It is required for AW Stats, which uses perl for generating response.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Simply use something like this in a jsp/servlet:

Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(cmd);
proc.getInputStream() // std out
proc.getErrorStream() // std err

Where cmd is a String[] with at index 0 the path to the command, the path to perl in your case and the rest of the array the commandline options "param=value", "--someoption", ....

There's also a variant of the exec method where you can set env variables, I think.

This is all documented in the Java API of course. It might be that the default security manager settings in your appserver have a rule against executing native commands in which case you will need to tweak these settings.

Good luck,

Jilles

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to