dev@javaserverfaces.java.net

Re: EL: isReadOnly()

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Thu, 10 Jan 2008 16:25:56 -0800

Matthias Wessendorf wrote:
> Ryan/Jacob.
>
> is this in the EL-Spec ?
> that something like
> <input value="" /> returns a readOnly:true ValueExpression?
>
The spec states:

Expressions that can have a value set on them are referred to as
l-value expressions. Those that cannot are referred to as r-value
expressions. Not all r-value expressions can be
used as l-value expressions (e.g. “${1+1}” or “${firstName}
${lastName}”). See the EL
Specification for details. Expressions that cannot be used as l-values
must always return true from
isReadOnly().

"" cannot be an l-value.
> Thx,
> Matthias
>
> On Jan 7, 2008 11:00 AM, Jacob Hookom <jacob_at_hookom.net> wrote:
>
>> Yeah... the work I did on the Apache EL was pre-spec completion and
>> there's since been other patches submitted through Tomcat by the
>> IBM/Geronimo folks.
>>
>>
>> Matthias Wessendorf wrote:
>>
>>> Nope, just that the JSF 1.1 EL was (in MyFaces ;-) ) returning null as well.
>>>
>>> -M
>>>
>>> On Jan 7, 2008 7:31 PM, Ryan Lubke <Ryan.Lubke_at_sun.com> wrote:
>>>
>>>
>>>> Matthias Wessendorf wrote:
>>>>
>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> If it's not a real expression then shouldn't it be read-only? You
>>>>>> certainly can't call
>>>>>> setValue() on it and expect it to work. So I think my original quote
>>>>>> still holds true.
>>>>>>
>>>>>>
>>>>>>
>>>>> I wonder why tomcat handle's this as NULL.
>>>>> In case of an object, the readonly is OK.
>>>>>
>>>>>
>>>>>
>>>> I think it's a bug in Tomcat's EL implementation.
>>>>
>>>> See what I've quoted previously. Can you find something in the spec to
>>>> support
>>>> your thoughts about the Tomcat behavior being correct?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>> -Matthias
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>> What is your take on that ?
>>>>>>>
>>>>>>> -Matthias
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Dec 20, 2007 11:39 PM, Matthias Wessendorf <matzew_at_apache.org> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> yah,
>>>>>>>> tomorrow :-)
>>>>>>>>
>>>>>>>>
>>>>>>>> On Dec 20, 2007 9:09 PM, Jacob Hookom <jacob_at_hookom.net> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>> I agree with Ryan, it should be read-only-- if you get that VE, can you
>>>>>>>>> do a getClass() on it and let us know the type?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Ryan Lubke wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> Matthias Wessendorf wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> ok, this is only in Jetty;
>>>>>>>>>>> just tested w/ a tomcat 6.x
>>>>>>>>>>>
>>>>>>>>>>> and <tr:inputText label="Label a)" value=""/>
>>>>>>>>>>> renders as a regular inputText field;
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> I think this may be a bug in Tomcat. The javadocs for ValueExpression
>>>>>>>>>> states:
>>>>>>>>>>
>>>>>>>>>> <quote>
>>>>>>>>>> In previous incarnations of this API, expressions could only be read.
>>>>>>>>>> ValueExpression objects can now be
>>>>>>>>>> used both to retrieve a value and to set a value. Expressions that can
>>>>>>>>>> have a value set on them are referred to as
>>>>>>>>>> l-value expressions. Those that cannot are referred to as r-value
>>>>>>>>>> expressions. Not all r-value expressions can be
>>>>>>>>>> used as l-value expressions (e.g. "${1+1}" or "${firstName}
>>>>>>>>>> ${lastName}"). See the EL
>>>>>>>>>> Specification for details. Expressions that cannot be used as l-values
>>>>>>>>>> must always return true from
>>>>>>>>>> isReadOnly().
>>>>>>>>>> </quote>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>> -M
>>>>>>>>>>>
>>>>>>>>>>> On Dec 20, 2007 5:43 PM, Matthias Wessendorf <matzew_at_apache.org> wrote:
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> I have a <tr:inputText value="">
>>>>>>>>>>>> The underlying API, says this ValueExpression is readOnly.
>>>>>>>>>>>>
>>>>>>>>>>>> A simple JSPX makes that clear
>>>>>>>>>>>> (I am on JETTY jetty-6.1.2rc2 and the RI )
>>>>>>>>>>>> I think, they (re) use the glassfish shipped javax.el
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> <?xml version='1.0' encoding='utf-8'?>
>>>>>>>>>>>> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="1.2">
>>>>>>>>>>>>
>>>>>>>>>>>> <jsp:directive.page contentType="text/plain"/>
>>>>>>>>>>>> <jsp:directive.page import="javax.servlet.jsp.*"/>
>>>>>>>>>>>> <jsp:directive.page import="javax.el.*"/>
>>>>>>>>>>>> <jsp:directive.page import="javax.faces.context.*"/>
>>>>>>>>>>>> <jsp:scriptlet>
>>>>>>>>>>>> JspApplicationContext jac =
>>>>>>>>>>>> JspFactory.getDefaultFactory().getJspApplicationContext(application);
>>>>>>>>>>>> ExpressionFactory ef = jac.getExpressionFactory();
>>>>>>>>>>>> ValueExpression ve = ef.createValueExpression("", Object.class);
>>>>>>>>>>>> out.println(ve.isLiteralText());
>>>>>>>>>>>>
>>>>>>>>>>>> out.println(ve.isReadOnly(FacesContext.getCurrentInstance().getELContext()));
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> </jsp:scriptlet>
>>>>>>>>>>>> </jsp:root>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> Matthias Wessendorf
>>>>>>>>>>>>
>>>>>>>>>>>> further stuff:
>>>>>>>>>>>> blog: http://matthiaswessendorf.wordpress.com/
>>>>>>>>>>>> sessions: http://www.slideshare.net/mwessendorf
>>>>>>>>>>>> mail: matzew-at-apache-dot-org
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>> 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
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> Matthias Wessendorf
>>>>>>>>
>>>>>>>> further stuff:
>>>>>>>> blog: http://matthiaswessendorf.wordpress.com/
>>>>>>>> sessions: http://www.slideshare.net/mwessendorf
>>>>>>>> mail: matzew-at-apache-dot-org
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>> ---------------------------------------------------------------------
>>>>>> 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
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.5.516 / Virus Database: 269.17.13/1213 - Release Date: 1/7/2008 9:14 AM
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_javaserverfaces.dev.java.net
>> For additional commands, e-mail: dev-help_at_javaserverfaces.dev.java.net
>>
>>
>>
>
>
>
>