In JSTL 1.0, you cannot execute arbitrary methods of beans.  In JSP 2.0,
you'll be able to set up EL "functions" that let you call methods you've
decided are appropriate for page authors.

In the meantime, if you have a method like getSingle(String), you may want
to expose it as a Map with the various potential argument strings as
keys.  Then, you'd be able to write

 ${bean.single['foo']}

Hope that helps,

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com

On Fri, 27 Sep 2002, Eddie Bush wrote:

> Hi guys - small question I haven't had much success at solving:  How 
> would you do something like:
> 
> <c:set var="foo" value="${requestScope['someBean'].singleItem['foo']"/>
> 
> I have a bean which has a Collection attribute.  Some of it's methods 
> include:
> 
>     - getCollection()
>     - setCollection(Collection c)
>     - addSingle(SingleBean sb)
>     - getSingle(String id)
> 
> What I want to do is invoke getSingle.  The only way I'm able to get 
> getSingle recognized is to use bean patterns 
> (getSingle()/setSingle(SingleBean)).  What I am trying to do is effect a 
> lookup in the Collection - but I have to manually do it (iterate over 
> the collection doing comparisons).
> 
> Suggestions?  Am I missing something simple here?
> 
> Thanks!
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to