import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class HelloServlet extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String q = req.getParameter("q"); PrintWriter out = resp.getWriter(); out.println(""); out.println(""); out.println("The paramter q was \"" + q + "\"."); out.println(""); out.println(""); } protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { String field = req.getParameter("field"); PrintWriter out = resp.getWriter(); out.println(""); out.println(""); out.println("You entered \"" + field + "\" into the text box."); out.println(""); out.println(""); } }