JSP页面中如何取得地址栏中传递的参数?

如果,就是从其它JSP页面跳转到本JSP页面时地址栏会传递参数,如何在本JSP页面中直接取得?

登陆页面:
login.jsp?username=zhangsan&password=123456
在本页面读出来:
String str1=request.getParameter("username");
String pwd=request.getParameter("password");
温馨提示:答案为网友推荐,仅供参考
第1个回答  2009-08-24
reques。getparm()
这个就行,直接获得参数名
第2个回答  2009-08-24
login?username=chen&password=123
post方式可能是乱七八糟的码。
直接 request.getParameter("username");
request.getParameter("password");