• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Telnet client from webapp [was: Help needed in jsp and beans]

 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).

Please help me with this as I m new to jsp

Thanks a lot to all the people in advance

[BPSouther: Removed URGENT from subject line.]

[ March 26, 2008: Message edited by: Ben Souther ]
[ March 26, 2008: Message edited by: Ben Souther ]
 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Govind SrinivasaRaghavan

Try to find some info in System.getProperty();
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Syed Saifuddin:
Try to find some info in System.getProperty();


What good would this do?
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much Mr Ben...but i m still confused about how actually it can be used to solve my problem... will i able to execute scripts in a remote machine with its help

(sorry if you think the question is stupid i m still trying to learn).

Thanks a lot in advance
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the other server have a webserver or application server on it?
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No...The scripts that I want to execute on this server are otherwise executed through telnet
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you. Well the specification that one of our clients have actually given us requires me to do that way( Since that server doesn't have any web/application server).
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mr Ben i am really sorry to be troubling you again, could you also tell me if i could keep getting the result of execution of such scripts from the server side and send it back to the client???
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't have any experience with writing telent clients from Java.
I assume that you can.

I'm going to change the title of this and move it to our Sockets and InternetProtocols forum since it's got more to do with networking and writing clients than with JSP.
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help Ben.... I hope that people in this forum can help me out with the problem that i am facing
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would start by going through the documentation provided by the commons/net libarary. You might be able to find the answer faster by yourself.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hari Srinivas
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well thanks a lot everyone....i was able to do that...thank you Ben and Ulf for your suggestions
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic