文档介绍:×÷Õߣºblackwhites
ÈÕÆÚ£º2000-9-30 10:06:33
package coreservlets;
import .*;
import .*;
import .*;
import .*;
/** Shows all the parameters sent to the servlet via either
GET or POST. Specially marks parameters that have
no values or multiple values.
<P>
Taken from Core Servlets and JavaServer Pages
from Prentice Hall and Sun Microsystems Press,
/.
&copy; 2000 Marty Hall; may be freely used or adapted.
*/
public class ShowParameters extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
("text/html");
PrintWriter out = ();
String title = "Reading All Request Parameters";
((title) +
"<BODY BGCOLOR=\"#FDF5E6\">\n" +
"<H1 ALIGN=CENTER>" + title + "</H1>\n" +
"<TABLE BORDER=1 ALIGN=CENTER>\n" +
"<TR BGCOLOR=\"#FFAD00\">\n" +
"<TH>Parameter Name<TH>Parameter Value(s)");
Enumeration paramNames = ();
while(()) {
String paramName = (String)();
("<TR><TD>" + paramName + "\n<TD>");
String[] paramValues =