Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring 使用JSTL迭代和绑定列表_Spring_Jsp_Spring Mvc_Jstl - Fatal编程技术网

Spring 使用JSTL迭代和绑定列表

Spring 使用JSTL迭代和绑定列表,spring,jsp,spring-mvc,jstl,Spring,Jsp,Spring Mvc,Jstl,我有一个坐标对象列表: public class Coordinate { Integer id; Integer x; Integer y; } 但我犯了这个错误 javax.servlet.jsp.JspException:org.springframework.beans.InvalidPropertyException:Invalid属性“myList[javax.servlet.jsp.jstl.core.LoopTagSupport”$1Statu

我有一个坐标对象列表:

public class Coordinate {

    Integer id;
    Integer x;
    Integer y;

}


但我犯了这个错误

javax.servlet.jsp.JspException:org.springframework.beans.InvalidPropertyException:Invalid属性“myList[javax.servlet.jsp.jstl.core.LoopTagSupport”$1Status@a6dfb0]'of bean class[MyForm]:属性路径'myList[javax.servlet.jsp.jstl.core.LoopTagSupport]中的索引无效$1Status@a6dfb0]'; 嵌套异常是java.lang.NumberFormatException:对于输入字符串:“javax.servlet.jsp.jstl.core.LoopTagSupport”$1Status@a6dfb0“

像这样尝试:

<form:input path="myList[${elemIndex.index}].x" size="5" />

假设
elemIndex
是您在
c:forEach
中设置的
varStatus
属性

这是

<form:input path="myList[${elemIndex.index}].x" size="5" />