比如是http://lcoalhost:8080/test/test.action?username=zhangsan
我是想得到zhangsan这个参数,请教路过的高人指点迷津,可以邮箱[email protected]

解决方案 »

  1.   

    可以在test.action中
    1. request.getParameter("username")
    2. 通过在test.action中设置username属性及get,set方法,就可以直接在action使用username,struts2自动映射过去的
    3. 通过对象的方式,,username为对象的某个属性然后实现ModelDriven
      

  2.   

    时间长了怎么办?你可以存到数据库中或者cookie中!