一样的,你非要用struts的标签库吗?

解决方案 »

  1.   

    是的,要用struts标签,是不是跟form表单一样处理 ?
      

  2.   

    传:
    <%
      String newValue = "New string value";
      pageContext.setAttribute("newValue", newValue);
     %>
       <html:link page="/test.jsp"
              paramId="stringProperty" paramName="newValue">
        String via paramId and paramName
      </html:link>
    取:
      <logic:present parameter="stringProperty">
      <bean:parameter name="stringProperty" id="par1"/>
      <bean:write name="par1"/>
      </logic:present>
      

  3.   

    楼上的能不能解释一下:paramID和paramName是不是固定格式的?
    如果我想传递二个或以上的参数该怎么办?
      

  4.   

    struts中同样可以这样传递和接受
    如:
    <html:form action="/actionLogin.do" method="POST">
      <table border="1" align="center" width="80%">
          <tr>
            <td>用户名</td>
            <td>密码</td>
            <td>操作</td>
          </tr>
          <logic:iterate id="disp" name="userList" type="strutstest.ActionFormUserData">
          <tr>
            <td><bean:write name="disp" property="username"/></td>
            <td><bean:write name="disp" property="password"/></td>
            <td>//下面代码就是
              <a href="updateAction.do?action=updateInit&username=<bean:write name="disp" property="username"/>">[修改]</a>
              <a href="updateAction.do?action=del&username=<bean:write name="disp" property="username"/>">[删除]</a>
            </td>
          </tr>
        </logic:iterate>
      </table>
    <html:button property="add" value="添加" onclick="addUser()">
    </html:button>
    </html:form>
    </body>
    </html:html>