FileDocCategorySizeDatePackage
ListParametersServlet.javaAPI DocExample972Mon Jul 01 09:49:52 BST 2002None

ListParametersServlet

public class ListParametersServlet extends HttpServlet
List all the values of all the Parameters

Fields Summary
Constructors Summary
Methods Summary
public voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)


		PrintWriter out = response.getWriter();

		out.println("<html><head><title>List Parameters</title></head>");
		out.println("<body><h1>Parameters</h1>");
		out.println("<ul>");
		Enumeration e = request.getParameterNames();
		while (e.hasMoreElements()) {
			String key = (String)e.nextElement();
			String[] values = request.getParameterValues(key);
			for (int i=0; i<values.length; i++) {
				out.println("<li>" + key + "[" + i + "] = " + values[i] + "</li>");
			}
		}
		out.println("</ul>");
	
public voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

		doGet(request, response);