public class SampleServlet extends HttpServlet {
public void doGet( HttpServletRequest request,
HttpServletResponse response )
throws ServletException,IOException {
response.setContentType("text/html;charset=Windows-31J");
PrintWriter out = response.getWriter();
out.println("<html><body>");
Map map = request.getParameterMap();
Iterator it = map.keySet().iterator();
while (it.hasNext()) {
String name = (String)it.next();
String[] val = (String[])map.get(name);
for (int i = 0;i<val.length;i++) {
out.println(name + "=" + val[i] + "<br>");
}
}
out.println("</body></html>");
}
}
|