Maybe a new tag that just uses introspection to call a named method on a
bean wouldn't be a bad idea...

-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW/ 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: c tang [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 11, 2001 5:17 PM
> To: [EMAIL PROTECTED]
> Subject: Re: new feature
> 
> 
> 
> --- "Craig R. McClanahan" <[EMAIL PROTECTED]> wrote:
> > 
> > 
> > On Thu, 11 Oct 2001, c tang wrote:
> > 
> > > Date: Thu, 11 Oct 2001 06:21:57 -0700 (PDT)
> > > From: c tang <[EMAIL PROTECTED]>
> > > Reply-To: [EMAIL PROTECTED]
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: new feature
> > >
> > > Maybe I have not clearly stated my case.
> > > Let me give you an example, hope that will help.
> > >
> > > A Bean defines a method called findWhere which
> > > calls a ejb bean and return a Collection of
> > > objects.  In current implementation, There is no
> > way
> > > to use taglib to get hold of the collection of
> > object
> > > in a jsp page other than usng ugly scriptlet. 
> > Does
> > > that go against what taglib is all about?
> > >
> > 
> > To accomplish your goal without any changes to the
> > current code, you have
> > three choices:
> > 
> > * Change the name of the findWhere() method to
> > getWhere() so that
> >   it conforms to the JavaBeans design patterns.
> > 
> > * Add a BeanInfo class (see the JavaBeans
> > specification for more
> >   information) that tells the JDK that your "where"
> > method's
> >   property getter is named "findWhere" instead of
> > "getWhere".
> > 
> > * Add property getter methods that conform to the
> > standard JavaBeans
> >   design patterns in addition to (or instead of)
> > your findWhere method.
> > 
> > > ct
> > >
> > 
> > Craig
> > 
> 
> Yes, it will work if you tried to access objects in
> your own code.
> 
> A lot of time, you uses a third party classes that 
> you cannot change their interface.  I imagines that
> a wrapper class may be created.  But in my opinion,
> it is overkilled for a small task like this.
> 
> ct
> 
> > > --- [EMAIL PROTECTED] wrote:
> > > > -1.
> > > >
> > > > If someone wants to code their *beans* this way,
> > > > they should code/generate
> > > > a BeanInfo to go with it, IMHO.
> > > >
> > > > --
> > > > dIon Gillard, Multitask Consulting
> > > > Work:      http://www.multitask.com.au
> > > > JavaNews: http://www.multitask.com.au/JavaNews
> > > > ----- Forwarded by dIon Gillard/Multitask
> > > > Consulting/AU on 11/10/2001 02:44 PM -----Re:
> > new
> > > > feature
> > > >
> > > > -1
> > > >
> > > > Looking to call a method besides get*() runs
> > > > contrary to the JavaBean
> > > > specification. Struts should stick to the book.
> > > >
> > > > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > > > -- Custom Software ~ Technical Services.
> > > > -- Tel +1 716 737-3463
> > > > -- http://www.husted.com/about/struts/
> > > >
> > > >
> > > > c tang wrote:
> > > > >
> > > > > Hi there,
> > > > >
> > > > > I'd like a new feature being added to Nested
> > > > > References of bean tag.  Currently it can read
> > > > from
> > > > > property with getter method.  It would be nice
> > if
> > > > it
> > > > > can read from a pure method too.
> > > > >
> > > > > For example,
> > > > > currently
> > > > > property="foo.bar"
> > > > > is translated into the equivalent the Java
> > > > expression:
> > > > >     getFoo().getBar()
> > > > >
> > > > > I propose that if getBar() is not available,
> > > > > property="foo.bar"
> > > > > is translated into the equivalent the Java
> > > > expression:
> > > > >     getFoo().bar()
> > > > >
> > > > > This is a feature in webobject, which allows
> > > > access to
> > > > > an object without have to define an attribute.
> > > > >
> > > > > ct
> > > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Make a great connection at Yahoo! Personals.
> > > http://personals.yahoo.com
> > >
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 

Reply via email to