首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

java http处置所有参数

2012-11-25 
java http处理所有参数一个获取servlet,jsp,或其它java http请求的参数方式。?// 处理所有参数Enumeration

java http处理所有参数

一个获取servlet,jsp,或其它java http请求的参数方式。

?

// 处理所有参数

Enumeration e = request.getParameterNames();

while(e.hasMoreElements()){
String paramName = (String)e.nextElement();
String paramValue = (String)request.getParameter(paramName);
// 处理参数名paramName与参数值paramValue
}

?

//获取请求头信息

????? Enumeration e = request.getHeaderNames();
? ? ? while (e.hasMoreElements()) {
? ? ? ? ? String name = (String)e.nextElement();
? ? ? ? ? String value = request.getHeader(name);
? ? ? ? ? out.println(name + " = " + value);
? ? ? }

?

热点排行