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>");
Enumeration e = request.getParameterNames();
while ( e.hasMoreElements() ) {
String name = (String) e.nextElement();
out.println( name + "=" + request.getParameter(name) + "<br>");
}
out.println("</body></html>");
}
}
|