Return-Path: Delivered-To: apmail-jakarta-taglibs-user-archive@apache.org Received: (qmail 3043 invoked from network); 5 Sep 2002 16:14:08 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 5 Sep 2002 16:14:08 -0000 Received: (qmail 8162 invoked by uid 97); 5 Sep 2002 16:14:39 -0000 Delivered-To: qmlist-jakarta-archive-taglibs-user@jakarta.apache.org Received: (qmail 8098 invoked by uid 97); 5 Sep 2002 16:14:38 -0000 Mailing-List: contact taglibs-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tag Libraries Users List" Reply-To: "Tag Libraries Users List" Delivered-To: mailing list taglibs-user@jakarta.apache.org Received: (qmail 8073 invoked by uid 98); 5 Sep 2002 16:14:37 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Message-ID: <3D77834A.3010608@earthlink.net> Date: Thu, 05 Sep 2002 10:16:10 -0600 From: David Geary User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, fr-ca MIME-Version: 1.0 To: Tag Libraries Users List Subject: Re: set Collection size References: Content-Type: multipart/alternative; boundary="------------010004060305000200090400" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------010004060305000200090400 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Karr, David wrote: >>-----Original Message----- >>From: Hari Mukkala [mailto:hari.mukkala@trcinc.com] >>Sent: Thursday, September 05, 2002 7:26 AM >>To: Tag Libraries Users List >>Subject: c:set Collection size >> >>I am trying to get the size of a collection (ArrayList) and >>use in c:set ex: >>>"java.lang.String" to be applied to a List or array, but that >>value cannot be converted to an integer >> >>What is the correct way to get the size value. >> >> > >This question comes up a lot, and it probably will continue to do so. > >The JSTL expression language allows you to access JavaBeans properties, not >arbitrary instance variables or methods. This will change over time, but >for now, you'll have to use scriptlets, or perhaps your own custom tags. > It *might* change over time. Currently, the JSTL expression language (EL) does not allow willy-nilly method access; however, the EA version of JSP2.0 does for the moment. But there's no guarantee that the EL (which will be incorporated into JSP2.0) will continue to allow direct method access, other than JavaBeans-compliant setter and getter methods. For now, you can use the JSTL runtime libraries if you need to invoke methods other than JavaBeans-compliant setter and getter methods; see my other reply in this thread. david --------------010004060305000200090400--