request.getParameterNames 使用方法
<%@ page contentType="text/html; charset=gb2312" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<html>
<body>
<form action = "index.jsp" method = "get" >
<table align="center" width="800" >
<tr>
<td>Name:</td><td><input type="text" size = "20" name="name"></td>
</tr>
<tr>
<td>Password:</td><td><input type="password" size = "20" name="pwd"></td>
</tr>
<tr>
<td></td><td><input type="submit" value="submit" ></td>
</tr>
</table>
</form>
</body>
</html>
<%
Enumeration e = (Enumeration) request.getParameterNames();
while(e.hasMoreElements()) {
String parName=(String)e.nextElement();
out.println(parName+"<br>");
}
%>
|
posted on 2007-11-13 09:50
末日风情 阅读(10268)
评论(0) 编辑 收藏 所属分类:
JSP基础