dev@javaserverfaces.java.net

EL: isReadOnly()

From: Matthias Wessendorf <matzew_at_apache.org>
Date: Thu, 20 Dec 2007 17:43:20 +0100

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