I can think of two reasons why an access operator [] could be useful:

- It might make the _expression_ more readable, because you know that you
are operating on an array, List or Map by looking at the _expression_.

- The content of the access operator could be an _expression_ itself. Example:
        person.children[person.selectedChildIndex].name

If i you want to this then use ognl.
I will not support this by the basic stuff.


If you have a class that implements Map, you can not access a bean
property on the instance.

Let's say we have the following class:

        class Bar extends HashMap {
                public String getFoo() ...
        }

Now create an instance and populate it:

        Bar b = new Bar();
        b.put("yadda", "value");


The JSP EL Evaluator would return null for the following _expression_:

        b.foo


I think the Evaluator should look for a value in the map using
containsKey() and look for a bean property if nothing was found. On a
list, you could check if the key is numeric.


I though about this (List and Maps being beans)
For a list this is not that hard because if the next expresion can be converted to an int then it is just an int for the index.
(get1() is then not supported)
And if it can't be converted then we could check if a method is there.

For maps this is different.
Currently i see List/Maps are not beans. If i always use them as a List or Map.

First check if something is there (in the map) looks strange to me.
Because what happens if you do this:

mymap.value = x

and there is a setValue()  but not a map entry?
Should i use setValue or do a map update. (or both?)

I still like the current simple way of notation that i have now. And i think that we will say: do you want more use the ognl models.

johan


Reply via email to