Ashish Anand
Ashish Anand

Reputation: 3581

Integrating Shell Script and JSP

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?

Upvotes: 0

Views: 1212

Answers (1)

Vijay Agrawal
Vijay Agrawal

Reputation: 3821

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 :-)

Upvotes: 1

Related Questions