/******************************************************************** * * StateQuerier.java * * Last Modified: 5/12/00 * * This is a one servlet example which implements a form which * asks for the name of a state, and then sends theinputted data * to the same servlet by the POST method. The method doPost() * then handles the POST request queries the STATE table and * then display the results. * ********************************************************************/ import java.io.*; import java.text.*; import java.util.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class StateQuerier extends HttpServlet { public static String USERNAME = new String("user"); public static String PASSWORD = new String("pass"); public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(""); out.println("
"); String title = "State Info Query Engine"; out.println(""); out.print("
"); out.println(""); out.println(""); } public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { String stateName = request.getParameter("statename"); String state_capital = ""; String state_flower = ""; String state_bird = ""; response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(""); out.println(""); if (stateName != null) { out.println("