Search code examples
javastruts2type-conversionognl

How to populate a nested generic list with struts2 OGNL?


I am trying to populate an Action property from a JSP page. The action property is of the following class:

public class SearchResult<T> {
  private List<T> records;
  // getters/setters as needed
}

In the action, the type of the generic is specified.

private SearchResult<MyObject> searchResult;
// getters/setters as needed

I am trying to submit the following to the action, but the records list ends up either empty or filled with nulls (depending how many records I try to populate).

&searchResult.records[0].prop1.propA=value1
&searchResult.records[0].prop1.propB=value2
&searchResult.records[1].prop1.propA=value3
&searchResult.records[1].prop1.propB=value4

Is there a different OGNL syntax I should be using or some other trick?


Solution

  • Since I'm not seeing any responses to this question, I'd say Struts2 doesn't support nested generic lists.