tell me about how to set the environment variables and how to run a
servlet program on
tomcat?
I tried this on my computer and this message shows in the command line....
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class TinyServ extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
out.println("<title>Well House Consultants #1 Servlet</title>");
out.println("</head>");
out.println("<body bgcolor=\"white\">");
out.println("<h1>Greetings from Well House Consultants</h1>");
out.println("This is the page body</body>");
out.println("</html>");
}
}
To compile :javac TinyServ.java
to run :
java TinyServ
and the this error message appears:
Exception in
thread "main" java.lang.NoSuchMethodError: main