Take the 2-minute tour ×  How to pass a hidden value in a form
in Spring MVC 3.0  I am not able to assign a value to a hidden
field using <form:hidden path="test" />. How can I set the value
of the test field and access it on the server side.
share|improve this question Is test a member variable of your
command/form object? –  Raghuram Mar 17 '11 at 11:46 yes ... it
part of the modelAttribute <form:form method="post"
action="/add" modelAttribute="Rules" > <form:hidden path="test"
/> </form:form> –  Santhosh S Mar 17 '11 at 12:00 Can you post
your controller code please? –  Scobal Mar 17 '11 at 12:55
@RequestMapping(value = "/add", method = RequestMethod.POST)
public ModelAndView addRules( @ModelAttribute("Rules") Rules
rules, BindingResult result ) throws Exception { ...... } – 
Santhosh S Mar 18 '11 at 5:53 Have you checked the BindingResult
object for any errors? If 'test' cannot be bound to the Rules
model attribute you will see an error in there –  Scobal Mar 28
'11 at 19:46  3 Answers 3  <form:hidden p