Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

connect to a unix server through jsp and run a command  RSS feed

 
raj raaz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to connect to a unix server through jsp and run a command( ex ls -lrt) and display the out put in webpage using the same jsp.

Please tell the possible options. Due to security reasons i am not interested to try thirdparty API's.
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36438
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should be doing this in a Java class not a JSP. JSPs are only for presentation. Search for MVC for more details.

The Runtime.exec() and ProcessBuilder APIs let you make command line calls on the server the JSP is running on. For some other server, you'd need to run a command remotely through your server which still uses Runtime.exec() or ProcessBuilder.

I recommend ProcessBuilder since it is newer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!