I have an object that implements List and that also have some getters that I would like to access using EL.
However, when I write in my jsp page :
I get the following exception: javax.servlet.jsp.el.ELException: The "." operator was supplied with an index value of type "java.lang.String" to be applied to a List or array, but that value cannot be converted to an integer.
Is there a way to retrieve the value of a property myObject using EL ?
No, by creating a Frankensteins's Monster of an object that exhibits both the attributes of a List and a bean, you have broken the EL contract.
Section JSP.2.3.4 clearly states the order in which values are introspected. The check for List/Map happens before the object is treated as a bean, which is the fall-through case when the object doesn't match anything else.
An object cannot be treated as both. And that makes perfect sense; otherwise ambiguous and anomolous behavior is much too likely.