When I was configuring my jsf Beans,I got an error:the ArrayList type property get a wrong value,whose size() and content is doubled.
my project:
faces-config.xml
<managed-bean>
<managed-bean-name>testBean</managed-bean-name>
<managed-bean-class>
com.magic.jsfstudy.TestBean
</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>testList</property-name>
<property-class>java.util.ArrayList</property-class>
<list-entries>
<value-class>java.lang.Integer</value-class>
<value>3</value>
<value>1</value>
<value>4</value>
<value>1</value>
<value>5</value>
</list-entries>
</managed-property>
</managed-bean>
my TestBean.java
package com.magic.jsfstudy;
import java.util.ArrayList;
public class TestBean {
private ArrayList testList;
public ArrayList getTestList() {
return testList;
}
public void setTestList(ArrayList testList) {
this.testList = testList;
}
}
my start.jsp
<%@ taglib uri="
http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="
http://java.sun.com/jsf/core" prefix="f"%>
<f:view>
<html>
<head>
<title>the first test</title>
</head>
<body>
<h:form>
<p>
<h:outputText value="#{testBean.testList}" />
</p>
</h:form>
</body>
</html>
</f:view>
It should be [3,1,4,1,5] on the page,but it is[3, 1, 4, 1, 5, 3, 1, 4, 1, 5].
What`s wrong with it?how should I get the write result?
[Message sent by forum member 'wangjcheng' (wangjcheng)]
http://forums.java.net/jive/thread.jspa?messageID=210711