Spring MVC 2.5 Command object value is changed on form submit

183 views Asked by At

I have a string variable in command object which is a hidden tag in my jsp. An on click of a button i'm setting this variable with a value(example "test") and submitting the form.

On form submit, I get the control to my Validator.validate() method. In this method the value of the variable in command object is changed that is comma is getting appended to the value(Example "test,").

I have checked debugging at the java script side, correct value is set to the variable there(it doesnt have the extra comma appended to it) but when it reaches the validator its value is changed.

I'm not understanding why only that particular variable value is getting changed while all other values are set correctly.

Please suggest how should i rectify this

1

There are 1 answers

0
Paul John On BEST ANSWER

Are there two form fields with the same name. When two form fields have the same name - the values could get appended in a list.