I see JSTL as a kind of "read-only" interface to your data, effectively implementing the View in the MVC model. Frankly, I wouldn't want our web designers to be able to call methods other than getters. However, it still would be really helpful to have a standardized method of getting the number of objects without having to go through a <c:forEach>. Let's say e.g. you want to show a table, but only if you really have table rows to show. Right now I always have to implement a getNumberOfRows method.
-----Original Message----- From: Chen, Gin [mailto:[EMAIL PROTECTED]] Sent: Freitag, 15. M�rz 2002 16:30 To: 'Tag Libraries Users List' Subject: RE: JSTL tag forEach context question I think method invocation is a necessary idea in the current versions of JSTL that I've seen. There are still alot of things that seems unnecessarily complex in using soem of the taglibs. For example, to check if an arraylist is empty. You must first set up a variable to represent the size before you can see if it is empty. I realize that this is probably because of the way Java was designed (size doesnt have the getters necessary for most taglibs to work). -Tim -----Original Message----- From: Shawn Bayern [mailto:[EMAIL PROTECTED]] Sent: Friday, March 15, 2002 10:22 AM To: RAYMOND Romain Cc: Tag Libraries Users List Subject: Re: JSTL tag forEach context question On Fri, 15 Mar 2002, RAYMOND Romain wrote: > I'd like to pass a parameter to method called within the forEach tag. > This method have to initialize the collection used by forEach. And > this parameter is retrieved throught a request.getParameter()... > > We can do it using JSTL c-rt.tld but we would like to do it using the > c.tld taglib. This to improve our tests an mainly to simplify the end > user interface creation ... Currently, the JSTL expression language doesn't support method invocation. The JSR-052 expert group is currently considering adding it, but there are many who don't think it's necessary. Instead of making the JSTL expression language more like Java, the thought is that you could provide custom tags in cases where this functionality is absolutely necessary. Or you could expose a Map instead of an object that requires a parameter. I'd love to hear your thoughts on whether you really need method invocation in the EL. Was it just the first way that occurred to you of using JSTL to fit with a legacy application, or do you see it as a substantive, long-term need? -- Shawn Bayern Author, "JSP Standard Tag Library" http://www.jstlbook.com (coming this summer from Manning Publications) -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
