0

How can I integrate a shell script with jsp? I want to write a jsp and that jsp should be able to run shell scripts. How can I do the integration of both?

Ashish Anand
  • 3,531
  • 6
  • 34
  • 45

1 Answers1

1

See How to run Unix shell script from Java code?

You can do this from Java scriptlet inside of JSP and use the ProcessBuilder class to achieve what you want http://www.jsptut.com/Scriptlets.jsp

Usual suggestion of avoiding this (since it is costly to exec the shell process and also might be a maintenance and portability overhead) goes..I am sure there might be a good reason (legacy?) you want it :-)

Community
  • 1
  • 1
Vijay Agrawal
  • 3,751
  • 2
  • 23
  • 25