<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
在javascript中实现,提交表单的时候触发一个事件 <script> function onSubmit_onClick() { var id = "你要加的参数"; var url = "/edit.do?id="+id; form = document.forms[0]; form.action=url; form.submit(); } </script>
新用户名 : <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
我记得我以前这样做过,好像没问题
或者用
<input type="hidden" name="ddd" value="fff"/>
这样是没有问题,关键是怎么动态填充"ddd=lll",比如"ddd=<%=x%>"
在提交的按钮上写onclick="whatYouWant();"
然后,
<script>
function whatYouWant(){
document.forms[0].action = "/edit.do?ddd="<%=x%>;
document.forms[0].submit;
}
<script>
<script>
function onSubmit_onClick() {
var id = "你要加的参数";
var url = "/edit.do?id="+id;
form = document.forms[0];
form.action=url;
form.submit();
}
</script>
不过参数会显示在地址栏,为什么不考虑在form中用hidden参数呢
testForm为*.xml中配置的edit action对应的Form;