我要获得url中的参数值,在jsp中我知道是用 String str = request.getParameter("param")即可,但使用Struts2.0怎么在<s:form>中的一个<s:textfield>中获得这个参数值。谢谢

解决方案 »

  1.   

    <s:textfield name="userName" label="用户名"></s:textfield>其中userName和表单对应的action类的属性想对象,当你提交表单时,struts2会自动为你赋值的.
    一个简单的struts2的登陆
    http://blog.csdn.net/bt_lose/archive/2008/03/10/2163353.aspx
      

  2.   

    不行的,我这样试了下这样接受参数值<s:textfield name="complaints.sonum" value="${so}"  />
    但提示错误如下:According to TLD or attribute directive in tag file, attribute value does not accept any expressions
    好像不能接受表达式。
      

  3.   

    是action类的属性,而不是action.<属性名>
      

  4.   

    bt_lose的回答不是我所问的,我问的是表单接受参数值,而不是action接受参数值