tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Bergsten <h...@gefionsoftware.com>
Subject Re: Beefing up JSTL EL in JSP 2
Date Fri, 11 Oct 2002 23:51:35 GMT
Shawn Bayern wrote:
> On Fri, 11 Oct 2002, James Cook wrote:
> [...] 
>>Will this new, improved EL support reflection-like function calls, and
>>will we be able to:
>>
>>${mybean.customer(${page.range} * 2)}
> 
> 
> Yes, though the syntax will work differently from what you have
> assumed; it will instead look like
> 
>  ${mybean.customer(pageScope.range * 2)}
> 
> Note 'pageScope' instead of 'page' (this stays the same between JSTL 1.0
> and JSTL 1.1 / JSP 2.0), and the fact that "${}" still refers to an entire
> expression, not a single variable reference.

Shawn is rarely wrong, but here actually missed one detail: JSP 2.0 adds
_functions_ to the EL, but not _methods_ as is used in this example.
A function is a method on a specific class, declared in the TLD. It can
then be used in an EL expression like this:

   ${mylib:customer(mybean, pageScope.range * 2)}

Hans
-- 
Hans Bergsten		hans@gefionsoftware.com
Gefion Software		http://www.gefionsoftware.com
JavaServer Pages	http://TheJSPBook.com


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message