日期:2014-05-20  浏览次数:20677 次

URL参数传递
java中
http://localhost:8080/myStruts2.0/login.jsp?username=admin&password=admin&sex=男
如何将接受usermane的值和password的值

------解决方案--------------------
request 对象中的 getParameter(“传递的变量名”)
来获取参数值。

------解决方案--------------------
request.getParameter("对象名");
不建议中文
------解决方案--------------------
这样传 用户名和密码全曝光了 还是用POST吧
------解决方案--------------------
action类里直接定义commandID,username,password,mobile,content属性,设置get set方法,直接就能获取这些值了
------解决方案--------------------
struts1.3用过 struts2未进行深入了解
------解决方案--------------------
request.getParameter("username");
request.getParameter("password");