1

i want to create list of input by angularjs ng-repeat in spring mvc. so use this code

    <div ng-repeat="order in orders">
        <div>
            <input type="text" name="orders[{{$index}}].name">
            <input type="text" name="orders[{{$index}}].phone">
            <input type="text" name="orders[{{$index}}].mobile">
        </div>
   </div>

when i want to retrieve orders in spring controller this exception is catch.

   org.springframework.beans.InvalidPropertyException:
    Invalid property  'orders[]' of bean class Invalid index in property path 'orders[]';
    nested exception is java.lang.NumberFormatException: For input string: ""

1 Answer 1

1

You should do like this:

name="{{order[$index].name}}"//also, notice order not orders
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.