Javascript 无法使用bindingResult设置表单元素

Javascript 无法使用bindingResult设置表单元素,javascript,java,jsp,spring-mvc,Javascript,Java,Jsp,Spring Mvc,我试图在提交时从一个表单到另一个表单获取值。因为我需要使用post将信息从一个页面传递到另一个页面。 但是,对于对象,我得到null 这是我的密码: 表格1 <form:form id="user" modelAttribute="user" method="post" action=""> <form:input type="text" placeholder="" id="name" path="name" maxLength="10" style="width:1

我试图在提交时从一个表单到另一个表单获取值。因为我需要使用post将信息从一个页面传递到另一个页面。 但是,对于对象,我得到null

这是我的密码:

表格1

<form:form id="user" modelAttribute="user" method="post" action="">
    <form:input type="text" placeholder="" id="name" path="name" maxLength="10" style="width:150px" />
    <form:input type="text" placeholder="" id="address" path="name" maxLength="32" style="width:150px" />
    <form:input type="text" placeholder="" id="phone" path="phone" maxLength="32" style="width:150px" />        
</form:form>
控制器:

 @RequestMapping(value="/selectRule",method=RequestMethod.POST)
     public String updateRulesForUserRequest(Rule rule,BindingResult result,Model model,HttpServletRequest request,HttpServletResponse response){
        log.info("Select rules for user: "+rule.toString());


     }
2016-04-20 18:43:06,646 INFO  administrator - Select rules for user: Rule [name=, address=, phone=], org.springframework.validation.BindingResult.Rule=org.springframework.validation.BeanPropertyBindingResult: 0 errors - com.myApp.RuleController:112
日志:

 @RequestMapping(value="/selectRule",method=RequestMethod.POST)
     public String updateRulesForUserRequest(Rule rule,BindingResult result,Model model,HttpServletRequest request,HttpServletResponse response){
        log.info("Select rules for user: "+rule.toString());


     }
2016-04-20 18:43:06,646 INFO  administrator - Select rules for user: Rule [name=, address=, phone=], org.springframework.validation.BindingResult.Rule=org.springframework.validation.BeanPropertyBindingResult: 0 errors - com.myApp.RuleController:112

ModelAttribute注释应在方法参数中使用,而不是在形式中使用:请参见

ModelAttribute注释应在方法参数中使用,而不是在形式中使用:请参见

中缺少“#”:

在以下内容中缺少“#”:


已尝试在控制器中使用此:@ModelAttribute(“规则”)规则。但这并不奏效(已尝试在控制器中使用:@modeldattribute(“规则”)规则。但效果不佳:(
   $("#name").val(user);
                    $("#address").val(add);
                    $("#phone").val(phone);