比如a.jsp中,调用b.jsp:b.jsp?para1=xxx¶2=xxx,如果b.jsp事前不知道a.jsp在调用时会传递几个参数,现在我就是想获得para1、para2这两个参数的名字。如何做?用request.getParameterMap会将a.jsp中一些hidden之类的标签也一起读出,但我不需要,我只要b.jsp?问号后面的参数名。
用request.getAttributeNames好像也不对。谢谢!
用request.getAttributeNames好像也不对。谢谢!
Enumeration e = request.getAttributeNames();
while (e.hasMoreElements()) {
String key = (String)e.nextElement();
Object value = request.getAttribute(key);
out.println(" " + key + " = " + value);
}