package FinalProject; /** * Angela Chen * March 12, 2004 * */ import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import data.*; public class UserNameServlet extends HttpServlet { public void doGet( HttpServletRequest request, HttpServletResponse response ) throws IOException, ServletException { response.setContentType( "text/html" ); PrintWriter out = response.getWriter(); String firstName = request.getParameter( "firstName" ); String lastName = request.getParameter( "lastName" ); DataIO.writeUserName( firstName, lastName, "/home/a19chen/tomcat_html/WEB-INF/etc/Coordinates.txt" ); // use sendRedirect to pass parameters through the URL // instead of just bringing up the jsp response.sendRedirect("/a19chen/GenArt2.htm" ); } public void doPost( HttpServletRequest request, HttpServletResponse response ) throws IOException, ServletException { doGet( request, response ); } } //end class UserNameServlet