I am trying to iterate through a two dimensional array and have hit a wall.... below 
is source code from a class that displays the values in a calendar style format. How 
can I do the same thing by using the Struts iterate tags?

public String formatMatrix(int[][] aMatrix) {
        StringBuffer sb = new StringBuffer();
        
        for (int i = 0; i < aMatrix.length; i++) {
            for (int j = 0; j < aMatrix[i].length; j++) {
                if (aMatrix[i][j] > 0) {
                        sb.append(aMatrix[i][j] < 10 ? " " + aMatrix[i][j] : 
String.valueOf(aMatrix[i][j]));
                                        sb.append(" ");
                }
                else {
                        sb.append("   ");
                }
            }
                        sb.append("\n");
        }
        return sb.toString();
    }


This is how I'm trying to display the contents....

1  2   3  4  5  6  7
8  9  10 11 12 17 18
19 20 21 22 23 24 25

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to