I have a jsp page with some form fields....When user clicks the submit button, i must take some input and based on whichi must execute a shell script on another server... I use a bean to process the data from the jsp page and run a script on another server
The question is 1. How do i connect to that server (IP,Login and password info available) and execute that script ( I would normally do so using Telnet).
Writing a telnet client in Java (Servlet or JSP) is going to be tricky at best. One library that will help out a bit is the commons/net library. Which has some telnet capabilities. http://commons.apache.org/net/
Even with that, I can't picture it being easy to implement this in a solid fashion. Is there any reason that these scripts can't be wrapped as CGI calls with Apache or another web server?
What problem is that? Ben pointed you to a Telnet client implementation - it comes with an example program that uses it. If you've used Telnet successfully so far, that should enable you to do that programmatically as well.