struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Stephenson <dan.stephen...@gmail.com>
Subject OGNL - Multi-dimensional Array
Date Tue, 20 Oct 2009 17:04:33 GMT
Hello everyone,

I had a question regarding multi-dimensional arrays and how they are handled
by OGNL (struts2).

I have the following snippet in my JSP:

...
<input type="text" name="dataCollection[0][0]" id="data00" class="..."
maxLength="1" size="1"/>
<input type="text" name="dataCollection[0][1]" id="data01" class="..."
maxLength="1" size="1"/>
...

On the Action side I have a class variable declared at the top with a
corresponding setter:

...
private String[][] dataCollection;
...
public void setDataCollection(String[][] dataCollection)
{
   this.dataCollection = dataCollection;
}
...

I haven't had much difficulty handling the output of a two-dimensional array
such as this, but am unable to figure out the right way of handling this as
input.  I am using struts 2.0.14.

Thanks for your assistance.

Daniel Stephenson
dan.stephenson@gmail.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message