mardi 3 mars 2015

In MVC passing a list from JSP to the Controller

I'm trying to get an example of passing a list from JSP to the Controller to work:


http://ift.tt/1rKOCbF


the problem I have with this example is that I do not get the JSP /WebContent/WEB-INF/jsp/add_contact.jsp to work. He has the line:



<c:foreach items="${contactForm.contacts}" var="contact" varstatus="status">


and i'm getting errors with the varstatus variable. From where is he getting the values for this variable? He is using it as a list row index, but from where should the values come? I get the warning in eclipse that it is a not defined variable varstatus and if i still deploy it to tomcat, then i get the error that jstl foreach tag does not support more than one variable (as i already have the contact there).


Aucun commentaire:

Enregistrer un commentaire