import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;


public class HTMLViewGenerator2 extends HttpServlet {
public void init(ServletConfig config) throws ServletException {
super.init(config);
System.out.println("In the init() method of HTMLViewGenerator");
}
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
	
performTask(req, res, "POST", "HTMLViewHandler2");

}
public void performTask(HttpServletRequest req, HttpServletResponse res,
String method, String url) throws ServletException, IOException {
res.setContentType("text/html");
PrintWriter out = res.getWriter();
out.println("<HTML><TITLE>HTMLFormGenerator</TITLE><BODY>");
out.println("<H2>Select the Fields to View</H2><HR>");
out.println("<FORM METHOD=\"" + method + "\" ACTION=\"" + url + "\">");
out.println("<H2>Tell us What you like to see from the database: </H2>");
out.println("<B>Matriculation Nr: </B>");
out.println("<INPUT TYPE=TEXT NAME=immat><BR>");
out.println("<BR><input type=\"checkbox\" name=\"firstname\" value=\"yes\">First name</BR>");
out.println("<BR><input type=\"checkbox\" name=\"city\"      value=\"yes\">City</BR>");
out.println("<BR><input type=\"checkbox\" name=\"zip\"       value=\"yes\">Zip</BR>");
out.println("<BR><input type=\"checkbox\" name=\"country\"   value=\"yes\">Country</BR>");
out.println("<BR><input type=\"checkbox\" name=\"email\"     value=\"yes\">Email</BR>");
out.println("<BR><input type=\"submit\" value=\"View\" name=\"B1\"><input type=\"reset\" value=\"Reset\" name=\"B2\"></p>");
out.println("</FORM>");
out.println("</BODY><HTML>");
out.close();
System.out.println("In the doGet method");
}
}