You will definitely get a build error when compiling MyFaces if you
don't have jstl in the compile path.
The code in UIData does:
if (value instanceof DataModel) ...
else if (value instanceof List) ...
else if (value instanceof ResultSet) ...
so clearly MyFaces requires ResultSet as a dependency, even when the
runtime value of "value" isn't a ResultSet. And this seems to be
required by the JSF spec. I guess MyFaces could check for the presence
of jstl.ResultSet first before doing the instanceof, and assume that if
the class is not available then the parameter cannot be an instance of it!
I'm not so convinced that allowing Set as an underlying type for
DataModel is a good idea. A Set is inherently unordered. I guess it can
be assumed from a *practical* point of view that iterating over a set
will return the elements in the same order as long as the set doesn't
change though this is not official AFAIK. If it wasn't true then the
rows in the table could be displayed in a different order each time the
page is viewed (including refresh) which seems a bad idea from the
usability viewpoint. Even assuming iteration is "stable" when the set
doesn't change, there is *no* guarantee that ordering won't change when
an insert/delete occurs, meaning the table the user previously viewed
gets presented in quite a different order - not good I think.
Regards,
Simon
Dennis Byrne wrote:
I'm not getting build errors related to jstl. This is a
runtime exception that occurs even though the object bound to
@value is not a jstl.ResultSet.
I get the PropertyNotFoundException in the following 3
scenarios
1.0.9 h:dataTable & t:dataTable
1.1.1 h:dataTable
It appears @value can point to a Set for t:dataTable in
1.1.1 ? If so, thanks to whoever added this.
---- Original message ----
Date: Sun, 20 Nov 2005 15:15:40 +1300
From: Simon Kitching <[EMAIL PROTECTED]>
Subject: Re: dataTable exceptions w/ 1.1.1
To: MyFaces Discussion <[email protected]>
Dennis Byrne wrote:
just moved an app from 1.0.9 to 1.1.1 . I get one of
these
even though there is no JSTL in the whole app:
java.lang.NoClassDefFoundError:javax/servlet/jsp/jstl/sql/Resu
lt
Not a show stopper. Putting the jstl.jar in the classpath
solves this (the one received from ibiblio when running
the
download-deps ant task) .
See the Sun javadoc for UIData.getValue(). This requires a
DataModel to
automatically be created to wrap the user model when that is
any of:
java.util.List, java.sql.ResultSet,
javax.servlet.jsp.jstl.sql.Result.
So the dependency is really needed, ie the spec basically
mandates that
jstl is in the classpath when JSF is used. JSTL is listed as
a
dependency for MyFaces in the build.xml file.
However I still get this:
javax.faces.el.PropertyNotFoundException: Bean:
org.hibernate.collection.PersistentSet, property: gameId
... using the following in the JSP:
<h:dataTable styleClass="dataTable" var="item"
value="#{TeamCrud.unit.gamesForAwayTeamId}" >
<h:column>
<h:commandLink immediate="true"
value="Game #{item.gameId}"
action="#{GameCrud.retrieve}" >
<t:updateActionListener
property="#{GameCrud.id}"
value="#{item.gameId}" />
</h:commandLink>
</h:column>
</h:dataTable>
Note that the EL does not reference "gameId" of the Set,
but
rather "gameId" of an item in the Set.
Furthermore, the PropertyNotFoundException will go away if
I
change h:dataTable to t:dataTable .
Have either of these issues been addressed already?
Sorry, don't know anything about this one.
Regards,
Simon
Dennis Byrne