• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

connect to a unix server through jsp and run a command

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic