Thanks for your hint. Reading the specs it does not apply in my case, because propertyresolver methods are different based on the fact the object being accessed is a List/Array or another type of object. In my case, it is a List, so JSF will call the int version of propertyresolver, which will fail before entering resolver because it will first attempt to coerce the property name to an int. My only solution to keep with current design would be to use ELResolver, which is more flexible, but this is in JSP 2.1 specifications and is used for j2EE 5.
I think i'll better redesign my bean :)

Thanks for your time,
David Delbecq
Cosma Colanicchia wrote:
I don't have any link at hands, but if you search on google you will
easily found some tutorial about implementing a custom property
resolver.

Anyway, ProperyResolver are introduced by section 5 of JSF 1.1 Specifications.


Cosma

2006/7/24, David Delbecq <[EMAIL PROTECTED]>:
I don't see in specification where it is stated this strategy is
optional. Also, could you give me some reference on how to change the
PropertyResolver used?

Cosma Colanicchia wrote:
> In JSF it's up to the property resolver to choose a strategy. The
> default one, AFAIK, first check if it is a List or a Map.. only if
> this condition isn't satisfied it tries to get the bean property.
>
> You could write a PropertyResolver decorator to handle things as you
> need, for example checking the existence of a property even for the
> Collections, before accessing its elements.
>
> Cosma
>
> 2006/7/24, David Delbecq <[EMAIL PROTECTED]>:
>> Hello,
>>
>> according to expression language in JSP 2.0 specification (which jsf-el
>> uses) the value of exprA.exprB is the same as exprA[exprB]  and is
>> evaluated like that:
>>
>> .....
>> if exprA is a List, coerce exprB to an int, if coercion failed, error.
>>
>> I am in a situation where i have a Collection of items (List) which also
>> has some proerties (like a name).
>> However, if i do "theBean.name" expression language tries to convert
>> name to an int which fail and throws error, but what i want is in
>> expression to reach "public String getName();" in the bean.
>>
>> Does someone have a suggestion of expression to reach this property in
>> my collection? Thanks.
>>
>>



Reply via email to