You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
1.2 KiB
39 lines
1.2 KiB
// RequestTestServlet.java
|
|
|
|
package com.bullseyecomputing.test;
|
|
|
|
import java.io.*;
|
|
import java.util.*;
|
|
|
|
import javax.servlet.*;
|
|
import javax.servlet.http.*;
|
|
|
|
public class RequestTestServlet extends HttpServlet {
|
|
|
|
public void doGet(HttpServletRequest request, HttpServletResponse response)
|
|
throws ServletException, IOException {
|
|
|
|
Enumeration arglist;
|
|
String name, value;
|
|
PrintWriter out = response.getWriter();
|
|
|
|
response.setContentType("text/html");
|
|
out.print("<html>\n<head>\n");
|
|
out.print(" <title>Request Parameter Test</title>\n");
|
|
out.print(" <link rel=\"stylesheet\" href=\"style/common.css\"");
|
|
out.print(" type=\"text/css\">\n");
|
|
out.print("</head>\n<body>\n");
|
|
out.print(" <h3>Request Parameter Test</h3>\n");
|
|
out.print(" <table class=\"third\">\n ");
|
|
out.print(" <thead>\n <th>Name</th>\n");
|
|
out.print(" <th>Value</th>\n </thead>\n");
|
|
arglist = request.getParameterNames();
|
|
while(arglist.hasMoreElements()) {
|
|
name = arglist.nextElement().toString();
|
|
value = request.getParameter(name);
|
|
out.print(" <tr>\n <td>" + name + "</td>\n ");
|
|
out.print("<td>" + value + "</td>\n </tr>\n");
|
|
}
|
|
out.print(" </table>\n</body>\n</html>\n");
|
|
}
|
|
}
|