0

Can I use JSP to run OS commands ?

I have done similar thing in PHP and works fine using the shell_exec syntax.

Is it possible to do it in JSP ?

I was looking for something similar like this .

<?php
$output = shell_exec('ls -lart');
echo "<pre>$output</pre>";
?>
Vinod K
  • 1,885
  • 11
  • 35
  • 45

1 Answers1

0
Runtime.exec(String s)

not sure what you want, essentially you are asking how to run os commands in java. Refer to this Post

And in JSP, there are more restrictions, due to security concerns , you might not able to access files located out of the sandbox(that is the web container).

Community
  • 1
  • 1
zinking
  • 5,561
  • 5
  • 49
  • 81