dev@javaserverfaces.java.net

Re: UIComponentTag.isValueReference(String) is _at_deprecated... what should I use?

From: Adam Winer <adam.winer_at_oracle.com>
Date: Tue, 21 Feb 2006 11:04:11 -0800

Basically, the preferred pattern in EE 5 is to
just create the ValueExpression and use it as such
from there on out, literal or not, which saves your
code the need to store two instances and do
   if (_instance) != null)
    return _instance;
   else if (_expr != null)
     return _exprt.getValue(elContext);

... etc. Instead, just always go through the
expression.

-- Adam



Ken Paulsen wrote:
>
> Thanks Jacob,
>
> I was hoping I didn't have to create an expression to see if it needs to
> be an expression... but I guess it probably does approximately the same
> amount of "work" that an isValueReference(...) type of method would do
> (and if I do need to create it, it's already done).
>
> Thanks,
>
> Ken
>
> jacob_at_hookom.net wrote:
>> There is ExpressionFactory.createValueExpression(....);
>>
>> ValueExpression extends Expression
>> MethodExpression extends Expression
>>
>> Expression.isLiteral() <--- there
>>
>>
>>> I was updating some 1.1 code to 1.2. The code takes a String which may
>>> or may not contain a ValueBinding (ValueExpression), if it does it
>>> creates a ValueBinding / ValueExpression. I call this method to
>>> determine if this is the case or not.
>>>
>>> Ken
>>>
>>> Ryan Lubke wrote:
>>>
>>>
>>>> Ken Paulsen wrote:
>>>>
>>>>
>>>>> In JSF 1.2, UIComponentTag.isValueReference(String) is @deprecated...
>>>>> what should I use? I didn't see anything in javax.el.* that jumped
>>>>> out as the right thing to use.
>>>>>
>>>> There is no direct replacement. I've spoken to the EL folks about
>>>> possibly adding something to the javax.el API, but it's
>>>> probably to late in the game to do so.
>>>>
>>>> I'm curious, what's your use case?
>>>>
>>>>
>>>>> Ken
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>>>>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>>>>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>>>
>>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>
>>