package servlet;

import com.jscape.inet.ssh.SshException;
import java.io.*;
import java.net.*;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.*;
import javax.servlet.http.*;
import ssh.*;

public class ResultsServlet extends HttpServlet {

        protected void doPost(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        try {
            SshConnect ssh = (SshConnect) request.getSession().getAttribute("ssh");            
            PrintWriter out = response.getWriter();
            response.setContentType("text/plain;charset=UTF-8");
            try{
                out.println(ssh.Results());
            }finally{
                out.close();
            }
        } catch (SshException ex) {
            System.out.println(ex);
        }
    }
}
