I am using Spring input path in jsp
ex:
<div class="cell label">
<form:label path="order.paymentTransactions.payerEmail">Payer Mail</form:label>
</div>
<div class="cell">
<form:input path="order.paymentTransactions.payerEmail" name="payerEmail"/>
</div>
here, order is my main object and inside order, paymentTransaction is a List, i have to input data to check through dao in payerEmail.
But it showing error to me and invalid path. Please suggest me a good way to define the input path in jsp. thanks
You can do these:
These worked for me.
While mapping a list of bean in Spring, it is difficult to provide path attribute. You can replace the
<form:input>
with plain html<input>
.Here's a complete example to map List as form object in Spring MVC
Example: Spring MVC: Multiple Row Form Submit using List of Beans
The above example also discuss why it is difficult to use
<form:input>
while working with Lists. Its because if you try to use something like below:Spring will simple render this as HTML:
Ignoring the brackets [ ].
Thus its impossible to use
<form:input>
for mapping List.We can do mapping of list through spring . Please update in your site. Thank you.
Example: