<input type="hidden" name="id" value=<%=id%>>

解决方案 »

  1.   

    谢谢!有没有STRUTS标签可以完成这个功能?
      

  2.   

    用STRUTS还有<%%>有点不好看```
      

  3.   

    <html:form action="/edit">
    新用户名 : <html:text property="username"/><html:errors property="username"/><br/>
    新密码 : <html:password property="password"/><html:errors property="password"/><br/>
    <input type="hidden" name="id" value=<bean:write property="id" />>
    <html:submit/><html:cancel/>
    </html:form>好象不对!
    org.apache.jasper.JasperException: /edituser.jsp(17,40) According to the TLD or the tag file, attribute name is mandatory for tag write
      

  4.   

    <html:form action="/edit.do?ddd=lll">
    我记得我以前这样做过,好像没问题
    或者用
    <input type="hidden" name="ddd" value="fff"/>
      

  5.   

    <html:form action="/edit.do?ddd=lll">
    这样是没有问题,关键是怎么动态填充"ddd=lll",比如"ddd=<%=x%>"
      

  6.   

    用javascript控制,这样
    在提交的按钮上写onclick="whatYouWant();"
    然后,
    <script>
    function whatYouWant(){
       document.forms[0].action = "/edit.do?ddd="<%=x%>;
       document.forms[0].submit;
    }
    <script>
      

  7.   

    标签可以嵌套:<html:form action="/edit.do?ddd=<bean:write name="sss" property="yyy"/>">
      

  8.   

    在javascript中实现,提交表单的时候触发一个事件
    <script>
    function onSubmit_onClick() {
         var id = "你要加的参数";
         var url = "/edit.do?id="+id;
         form = document.forms[0];
         form.action=url;
         form.submit();
    }
    </script>
      

  9.   

    struts没有这样的标签,要么你自己写taglib,要么向楼上说的,用标签嵌套
    不过参数会显示在地址栏,为什么不考虑在form中用hidden参数呢
      

  10.   

    <input type="hidden" name="id" value=<bean:write property="id" />><bean:write name="testForm" property="id" />
    testForm为*.xml中配置的edit action对应的Form;