public class RequestDemo2 extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String value = request.getParameter("username");
if(value!=null&&!value.trim().equals("")){
System.out.println(value);
}
System.out.println("------------------------------");
Enumeration
e = request.getParameterNames();
while(e.hasMoreElements()){
String name = e.nextElement();
value = request.getParameter(name);
System.out.println(name + "="+value);
}
}
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
}
}