dev@javaserverfaces.java.net

Re: EL: isReadOnly()

From: Matthias Wessendorf <matzew_at_apache.org>
Date: Thu, 20 Dec 2007 23:39:25 +0100

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
> > Speciļ¬cation 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