久丰学习Jsp&Servelet的笔记(写出一个 servelet 程序) |
|
日期:2007-5-25 11:44:35 人气:198 [大 中 小] |
|
|
|
boolean emptyEnum = false; if (! paramNames.hasMoreElements( )) emptyEnum = true; //set the MIME type of the response, "text/html" response.setContentType("text/html"); //use a PrintWriter to send text data to the client java.io.PrintWriter out = response.getWriter( ); //Begin assembling the HTML content out.println("<html><head>"); out.println("<title>Submitted Parameters</title></head><body>"); if (emptyEnum) ...{ out.println( "<h2>Sorry, the request does not contain any parameters</h2>"); } else ...{ out.println( "<h2>Here are the submitted parameter values</h2>"); } while(paramNames.hasMoreElements( )) ...{ parName = (String) paramNames.nextElement( ); out.println( "<strong>" + parName + "</strong> : " + request.getParameter(parName)); out.println("<br />"); }//while out.println("</body></html>"); } |
|
出处:本站原创 作者:佚名 |
|
|