RE: Return Telnet result in Jsp how?

2001-11-24 Thread Domingo Aguilera

If you only need to authenticate a user, and where you have the telnet
service or daemon exists a pop3 server, you can create a java class that
attempts to authenticate to the pop3 daemon. If the user and password where
good it returns OK , otherwise returns NOT OK.

import java.io.*;
import java.net.*;
class  POP3UserValidation
{
public static void main(String[] args)
{
if (args.length != 2)
{
System.out.println(Usage:  java POP3UserValidation username ,
password );
System.exit(0);
}

POP3UserValidation PUV = new POP3UserValidation();
String userStatus = ;
try
{
userStatus = PUV.checkUser(args[0], args[1]) ? OK :  NOT 
OK;
}
catch ( Exception e)
{
e.printStackTrace();
}

System.out.println(User is  + userStatus);
}

public boolean checkUser( String user, String pass) throws IOException {

Socket s = new Socket(yourpopserver.yourdomain.com, 110);
 BufferedReader in  = new BufferedReader(
 new InputStreamReader(s.getInputStream()));
 BufferedWriter out = new BufferedWriter(
 new OutputStreamWriter(s.getOutputStream()));
 int msgnr =  0;
 String resp;
 receive(in);
 send(out, USER  + user);
 resp = receive(in);

 if ( resp.substring(0,4).equals(-ERR))
 {
  return false;
 }
 send(out, PASS  + pass);
 resp = receive(in);

 if ( resp.substring(0,4).equals(-ERR))
 {
  return false;
 }

 send(out, QUIT );
 return true;

}

 private void send(BufferedWriter out, String s) throws IOException {
 out.write(s+\n);
 out.flush();
 }

  private String receive(BufferedReader in) throws IOException {
 return in.readLine();
 }
}

-Mensaje original-
De: Miao, Franco CAWS:EX [mailto:[EMAIL PROTECTED]]
Enviado el: Viernes, 23 de Noviembre de 2001 03:08 p.m.
Para: 'Tomcat Users List'
CC: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Asunto: Return Telnet result in Jsp how?


Hi there, I got a project need to do with Jsp, which let user input their
userID and password in Jsp, then Jsp talk to backend Telnet server, and
return the login result in Jsp or Html format, further more it also can let
user run more query command.  Anyone can give me some idea for this?

Thanks!


Franco

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Return Telnet result in Jsp how?

2001-11-24 Thread Miao, Franco CAWS:EX

Hi there, I got a project need to do with Jsp, which let user input their
userID and password in Jsp, then Jsp talk to backend Telnet server, and
return the login result in Jsp or Html format, further more it also can let
user run more query command.  Anyone can give me some idea for this?

Thanks!


Franco

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Return Telnet result in Jsp how?

2001-11-24 Thread Miao, Franco CAWS:EX

any web site as sample / doc reference ? thanks!

Franco 

-Original Message-
From: Huaxin [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 23, 2001 1:08 PM
To: Tomcat Users List
Subject: Re: Return Telnet result in Jsp how?


You should use a legacy system driver to do this.
one example would be BlackSmith at Celcorp, they
have a Java interface for it, good for me
(VT100, IBM 3725)

On Fri, 23 Nov 2001, Miao, Franco CAWS:EX wrote:

 Hi there, I got a project need to do with Jsp, which let user input their
 userID and password in Jsp, then Jsp talk to backend Telnet server, and
 return the login result in Jsp or Html format, further more it also can
let
 user run more query command.  Anyone can give me some idea for this?

 Thanks!


 Franco

 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]



--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]