aspose file tools*
The moose likes JSP and the fly likes Calling Linux shell in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling Linux shell in JSP" Watch "Calling Linux shell in JSP" New topic
Author

Calling Linux shell in JSP

ajay chaturvedi
Greenhorn

Joined: Jul 31, 2002
Posts: 16
I have a Linux shell which take two parameters
how do i call this shell from JSP.
Please help :roll:
Shawn Bayern
Author
Ranch Hand

Joined: May 06, 2002
Posts: 160
Originally posted by achaturvedi:
I have a Linux shell which take two parameters
how do i call this shell from JSP.
Please help :roll:

You can use Runtime.getRuntime().exec() to call an outside program. Just build up a command-line containing the two arguments and pass it to exec(). (There's an overloaded exec() function that also takes an explicit argument list. See the Javadoc for java.lang.Runtime.)


Shawn Bayern<br />"JSTL in Action" <a href="http://www.jstlbook.com" target="_blank" rel="nofollow">http://www.jstlbook.com</a>
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"achaturvedi",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp.
We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements.
Thanks.
Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling Linux shell in JSP
 
Similar Threads
Advice needed for JOB Hunt for SUN
Calling shell script
Invoking a shellscript using JSP
difference between terminal and shell-Konsole windows?
JSP Page to call Linux Shell Script