Hi, the problem indeed was in the HQL query - fixing the query resulted in a List with objects of type Gallery, that can be processed correctly by the posted forEach tag.
Much obliged, Thomas --- thomas delnoij <[EMAIL PROTECTED]> wrote: > David, > > I am assuming that it is a bean, with a String > property 'uniqueId'. > > I did find out by now that the HQL query that > creates > the List returns a collection of objects of Type > java.lang.Object and not of my desired custom Type > ('Gallery'). Casting them to the Gallery type in the > JSP leads to a ClassCastException. > > This means that first I have to fix the HQL query to > return a List of the required type... > > In this case though, I would expect a > PropertyNotFoundException to be thrown by the > forEach > tag and not a ServletException, don't you agree? > > Regards, > > Thomas Delnoij > --------------------- > @: [EMAIL PROTECTED] > ~: www.delnoij.com > Public Key: www.delnoij.com/pgp/0xC26346C3.txt > > > > --- "Karr, David" <[EMAIL PROTECTED]> wrote: > > > What I read from this error message is that the > type > > of "image" is a > > List or Array. That's what it's complaining > about. > > What are you > > assuming is the type of the objects in the > > "pageList" collection? If > > you assume each object is a List or Array, then > the > > syntax of > > "${image.uniqueId}" will not work. If you assume > > each object is a bean > > that has a "uniqueId" attribute, then you should > > check your assumptions, > > because it appears the objects in the list are > List > > or Array objects, > > not beans containing that attribute.. > > > > > -----Original Message----- > > > From: thomas delnoij [mailto:[EMAIL PROTECTED] > > > > > > I am having problems using the forEach tag. I am > > using > > > jstl 1.0 on Tomcat 5.0, Windows 2000. > > > > > > Code: > > > > > > <c:forEach items="${pagedImageList.pageList}" > > > var="image" > > > > <c:out value="${image.uniqueId}"/> > > > </c:forEach> > > > > > > The pagedImageList Object is a session scope > > object of > > > type > > > > org.springframework.beans.support.PagedListHolder. > > > > > > I have verified that it has method getPageList > > that > > > returns a java.util.List type object. > > > > > > I am getting: > > > > > > javax.servlet.ServletException: An error > occurred > > > while evaluating custom action attribute "value" > > with > > > value "${image.uniqueId}": The "." operator was > > > supplied with an index value of type > > > "java.lang.String" to be applied to a List or > > array, > > > but that value cannot be converted to an > integer. > > > (null) > > > > > > which for me in the moment is completely > > inexplicable. > > > > > > I have verified that the Collection used to > > initiate > > > the PagedListHolder object contains items. > > > > > > My question is if: > > > > > > - you can confirm that I am using the right EL > > syntax. > > > - what you would suggest is the most likely > cause > > of > > > the problem, so I can investigate further. > > > > > > Thanks in advance. > > > > > > Thomas > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]