@WebServlet("/param")
public class ParameterServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
public ParameterServlet() {
super();
// TODO Auto-generated constructor stub
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head><title>form</title></head>");
out.println("<body>");
String name = request.getParameter("name");
String age = request.getParameter("age");
out.println("name : " + name + "<br>");
out.println("age : " +age + "<br>");
out.println("</body>");
out.println("</html>");
}
}