Skip to content

Commit 3536b81

Browse files
author
Keith Donald
committed
failing nested list binding
1 parent a417aa2 commit 3536b81

File tree

1 file changed

+17
-4
lines changed
  • org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/mvc/annotation

1 file changed

+17
-4
lines changed

org.springframework.web.servlet/src/test/java/org/springframework/web/servlet/mvc/annotation/Spr7839Tests.java

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,23 @@ public void listElementAutogrowObject() throws Exception {
7070
}
7171

7272
@Test
73-
public void listOfListsElement() throws Exception {
73+
@Ignore
74+
public void listOfLists() throws Exception {
7475
request.setRequestURI("/nested/listOfLists");
76+
request.addParameter("nested.listOfLists[0]", "Nested1,Nested2");
77+
adapter.handle(request, response, controller);
78+
}
79+
80+
@Test
81+
public void listOfListsElement() throws Exception {
82+
request.setRequestURI("/nested/listOfListsElement");
7583
request.addParameter("nested.listOfLists[0][0]", "Nested");
7684
adapter.handle(request, response, controller);
7785
}
7886

7987
@Test
8088
public void listOfListsElementAutogrowObject() throws Exception {
81-
request.setRequestURI("/nested/listOfLists");
89+
request.setRequestURI("/nested/listOfListsElement");
8290
request.addParameter("nested.listOfLists[0][0].foo", "Nested");
8391
adapter.handle(request, response, controller);
8492
}
@@ -113,9 +121,14 @@ public void handlerMap(JavaBean bean) {
113121
public void handlerListElement(JavaBean bean) {
114122
assertEquals("Nested", bean.nested.list.get(0).foo);
115123
}
116-
124+
117125
@RequestMapping("/nested/listOfLists")
118126
public void handlerListOfLists(JavaBean bean) {
127+
assertEquals("Nested2", bean.nested.listOfLists.get(0).get(1).foo);
128+
}
129+
130+
@RequestMapping("/nested/listOfListsElement")
131+
public void handlerListOfListsElement(JavaBean bean) {
119132
assertEquals("Nested", bean.nested.listOfLists.get(0).get(0).foo);
120133
}
121134

@@ -143,7 +156,7 @@ public static class NestedBean {
143156
private List<NestedBean> list;
144157

145158
private List<List<NestedBean>> listOfLists;
146-
159+
147160
private Map<String, NestedBean> map = new HashMap<String, NestedBean>();
148161

149162
public NestedBean() {

0 commit comments

Comments
 (0)