> -----Original Message-----
> From: Hans Bergsten [mailto:[EMAIL PROTECTED]]
> Sent: Friday, October 11, 2002 4:52 PM
> To: Tag Libraries Users List
> Subject: Re: Beefing up JSTL EL in JSP 2
> 
> 
> 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)}

How would this map back to Java code? Is there any inferred relationship
between 'customer' and the method being called, and between 'mybean' and the
class on which the method is being invoked?

The syntax above seems to imply that, at least in this case, 'mybean'
corresponds to 'this'. I'm guessing that the method name need bear no
relation to the function name used in JSP, and that the mapping is specified
in the TLD? What about calling static methods?

I guess I should really go read the spec...

--
Martin Cooper


> 
> Hans
> -- 
> Hans Bergsten         [EMAIL PROTECTED]
> Gefion Software               http://www.gefionsoftware.com
> JavaServer Pages      http://TheJSPBook.com
> 
> 
> --
> 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]>

Reply via email to