import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import telnet.*; import java.lang.String; public class HelloTestServlet extends HttpServlet { /* public void init(ServletConfig config)throws ServletException { try{ super.init(config); String[] myargs = new String[4]; myargs[0]="osprey4.npac.syr.edu"; myargs[1]="23"; myargs[2]="ls -l"; myargs[3]="m1"; myclass[] myobj; myclass myobj1 = new myclass(); telnet teln = new telnet("webflow","wiQB5o7t",myargs); System.out.println("in the init method"); } catch(Exception e) { System.out.println("catch the exception"); } }*/ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { try{ String[] myargs; res.setContentType("text/html"); PrintWriter out = res.getWriter(); myargs = new String[4]; myargs[0]="osprey4.npac.syr.edu"; myargs[1]="23"; myargs[2]="ls -l"; myargs[3]="m1"; myclass myobj; // telnet tel2; System.out.println("hai there"); myobj = new myclass(); System.out.println("after the constructor"); int k = myobj.j; // tel2 = new telnet(); telnet tel1 = new telnet("webflow","wiQB5o7t",myargs); System.out.println("after the process"); out.println("Hello Client!"+ "Hello Client!"); out.close(); } catch (Exception ex) { System.out.println("thread exception"); } } public String getServletInfo() { return "HelloClientServlet"; } }